viz. https://arxiv.org/pdf/1608.06001.pdf for a definition and discussion. The authors of the linked article were kind enough to provide me with the sequences.
This file contains 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
<h1>(((Title)))</h1> | |
<div style="display:flex;justify-content:center;align-items:center;width:100%;clear:both;text-align:center"> | |
<span style="max-width:450px;"><img:(((Image id)))></span> | |
</div> | |
<p>(((Instruction paragraph)))</p> | |
<p>(((Instruction paragraph)))</p> | |
<!--- more as needed ---!> | |
<p><a href="https://f-puzzles.com/?id=(((puzzleID)))">F-puzzles link</a></p> |
This file contains 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
Here are the 24 arrangements of sudoku numbers such that each placed digit behaves like a queen, i.e., no instance of a given digit "sees" a copy of itself along a diagonal. They are in no particular order. In each grid, digits 1-7 are represented, and 8 & 9 would need to be filled in where there are zeros. The 24 grids all 'collapse' to only 4 unique patterns, with 8, 8, 4, and 4 reflection/rotational equivalents each. | |
Most of these arrangements are broken, however, as you cannot place exactly one 8 and one 9 in each box, column, and row without clashes. The exceptions are grids 3, 7, 19 and 20 (which are rotations of one another). Those four are therefore the only possible solutions to sudokus with 7 queens, disregarding transposition (i.e., substituting a different permutation of digits for 1-9). | |
The other 20 arrangements are still useful, however, as they can be used as the basis for puzzles with 6, 5 or fewer queens. | |
Grid 1. (broken) | |
123|450|670 | |
407|613|052 |
This file contains 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
digits = (1..9).to_a | |
evens, odds = [0,1].map {|num| digits.select{ |k| k % 2 == num}} | |
def all_subsets(ar) | |
result = [] | |
0.upto(ar.length) do |num| | |
result += ar.combination(num).to_a | |
end | |
result | |
end |
This file contains 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
# Usage: ruby commit-prepender this is my commit message without quotation marks | |
branch_name = %x.git rev-parse --abbrev-ref HEAD. | |
regex = Regexp.new(/[A-Z]*-[0-9]*/) | |
string_to_prepend = branch_name.match(regex).to_s | |
cmd = "git commit -m \"[#{string_to_prepend}] #{ARGV.join(" ")}\"" | |
`#{cmd} >&2` |
This file contains 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
dictionary = IO.readlines("path/to/your/dictionary").map {|word| word.chomp} | |
# you can replace "path/to/your/dictionary" with "/usr/share/dict/words", but I | |
# recommend a smaller dictionary, such as the one I've saved here: | |
# https://github.com/pgblu/dryphtwords/blob/master/app/fixtures/main_dictionary.txt | |
needed_length = ARGV[0].to_i | |
dropped_letter = ARGV[1] |
This file contains 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
let color1 = Math.round(Math.random() * 0xFFFFFF); | |
let fill1 = '#' + color1.toString(16).padStart(6,'0'); |
This file contains 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
# add this to your .bash_profile | |
# pomo() takes 0,1, or 3 arguments | |
# 1st is a time in minutes (default 25) | |
# 2nd and 3rd are a just-intonation ratio x:y (default 4:3) | |
# End the process with ctrl-C. | |
function pomo() { | |
case $# in | |
[0]*) | |
chuck ~/Documents/ChucK/pomo.ck |