RCSNUSP/Mathematica: Difference between revisions

m
Fixed syntax highlighting.
(Created page with "<lang Mathematica>$IterationLimit = Infinity; next[{x_, y_}, dir_] := {x, y} + Switch[dir, Up, {0, -1}, Down, {0, 1}, Left, {-1, 0}, Right, {1, 0}]; lurd[dir_] := ...")
 
m (Fixed syntax highlighting.)
 
Line 1:
<langsyntaxhighlight Mathematicalang="mathematica">$IterationLimit = Infinity;
next[{x_, y_}, dir_] := {x, y} +
Switch[dir, Up, {0, -1}, Down, {0, 1}, Left, {-1, 0},
Line 70:
FirstPosition[gProg,
"$"] /. {{y_, x_} :> {x, y}, _Missing -> {1, 1}},
StringDrop[input[], -1], "", Right, {0}, 1]];</langsyntaxhighlight>
Run as <code>WolframScript -script <file> <program...></code>.
9,485

edits