Code Snippets J

Short texts J 🧑‍💻 Code snippets J ✍️ Reading lists J 👀

Sudoku DIMACS format

# How the J Script Works Going line by line: “`j b =: >: i. 9 9 9 “` This generates a 9 by 9 by 9 array with all values from `1` to `729`. We can choose what each axis represents: I decided that each table is all of the boolean variables for one […]

tax.ijs

dot =: mp =: +/ .* thresholds =: 0 0.12 0.46 0.88 1.5 3 5 10 rates =: 0.06 0.15 0.24 0.35 0.38 0.4 0.42 0.45 marginal_rates =: 2 -~/\ 0, rates tax =: 13 : ‘marginal_rates dot 0 >. y – thresholds’ sells =: 10 + i. 10 buys =: 10 $ 5 market_buys […]