This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This file is machine-generated - editing it directly is not advised | |
[[AbstractFFTs]] | |
deps = ["LinearAlgebra"] | |
git-tree-sha1 = "485ee0867925449198280d4af84bdb46a2a404d0" | |
uuid = "621f4979-c628-5d54-868e-fcf4e3e8185c" | |
version = "1.0.1" | |
[[Adapt]] | |
deps = ["LinearAlgebra"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#= | |
Drawing Julia using a Fourier series. | |
A high definition animation can be seen here: https://youtu.be/rrmx2Q3sO1Y | |
This code is based on code kindly provided by ric-cioffi (https://github.com/ric-cioffi) | |
But was rewritten for v0.3 by Ole Kröger. | |
=# | |
using Javis, FFTW, FFTViews |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Luxor, ColorSchemes | |
using UnicodeFun | |
using Primes | |
struct PNGScene | |
opts::Dict{Symbol, Any} | |
end | |
function get_coord(val, radius) | |
θ = 2π*0.1*val |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Plots | |
const Φ = (1+√5)/2 | |
const ξ = (1-√5)/2 | |
function binet(n) | |
c = Complex(n) | |
return (Φ^c - ξ^c)/√5 | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using JuMP, ConstraintSolver, Combinatorics | |
const CS = ConstraintSolver | |
""" | |
get_possible_splits(p, n, wished_sum, split_point) | |
p = possible numbers like 1:9 in a normal numoku | |
n = number of elements in a row | |
wished_sum = the sum of a row | |
split_point = index of where the left part should be a multiple of the right part or the other way around |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using ConstraintSolver | |
using JuMP | |
const CS = ConstraintSolver | |
include("plot_search_space.jl") | |
function read_puzzle(fname) | |
lines = readlines("data/$fname") | |
npieces = length(lines) | |
puzzle = zeros(Int, (npieces, 5)) | |
for i=1:npieces |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This file is machine-generated - editing it directly is not advised | |
[[AbstractFFTs]] | |
deps = ["LinearAlgebra"] | |
git-tree-sha1 = "051c95d6836228d120f5f4b984dd5aba1624f716" | |
uuid = "621f4979-c628-5d54-868e-fcf4e3e8185c" | |
version = "0.5.0" | |
[[AbstractTrees]] | |
deps = ["Markdown"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using JuMP, GLPK | |
function graph_coloring(;fast=true, benchmark=false) | |
m = Model(with_optimizer(GLPK.Optimizer, msg_lev = 3)) | |
@variable(m, max_color, Int) | |
@variable(m, c[1:49,1:4], Bin) | |
@objective(m, Min, max_color) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Plots | |
using ColorSchemes | |
using Primes | |
using Plots.PlotMeasures | |
function plot_primes(x) | |
l_primes = primes(x) | |
colors = get(ColorSchemes.summer, [i/x for i in l_primes]) | |
anim = Animation("temp", String[]) | |
for i=1:100 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Plots | |
using ColorSchemes | |
using Primes | |
function plot_primes(x) | |
l_primes = primes(x) | |
colors = get(ColorSchemes.summer, [i/x for i in l_primes]) | |
scatter(l_primes, l_primes; size=(1000,1000), legend=false, axis=false, background_color=:black, foreground_color=:black, | |
proj=:polar, markersize=1, markercolor=colors) | |
png("polar_primes_$(x)") |
NewerOlder