mirror of
https://github.com/Smaug123/advent-of-code-2021
synced 2025-10-05 20:18:41 +00:00
Remove some Mathematica nonanswers
This commit is contained in:
@@ -1,7 +0,0 @@
|
||||
(* ::Package:: *)
|
||||
|
||||
nums=Import[StringJoin[NotebookDirectory[], "/input.txt"],"Table"];
|
||||
|
||||
part1 = 1##&@@Tr[1##&@@@(#/."up"->-"down")]&;
|
||||
|
||||
part2=1##&@@Rest@Fold[Function[{state,elt},Switch[elt[[1]],"forward",state+{0,elt[[2]],state[[1]] elt[[2]]},"down",MapAt[elt[[2]]+#&,state,1],"up",MapAt[#-elt[[2]]&,state,1]]],{0,0,0},#]&;
|
@@ -1,7 +0,0 @@
|
||||
(* ::Package:: *)
|
||||
|
||||
nums=Import[StringJoin[NotebookDirectory[], "/input.txt"],"Table"];
|
||||
|
||||
part1 = 1##&@@Tr[1##&@@@(#/."up"->-"down")]&;
|
||||
|
||||
part2=1##&@@Rest@Fold[Function[{state,elt},Switch[elt[[1]],"forward",state+{0,elt[[2]],state[[1]] elt[[2]]},"down",MapAt[elt[[2]]+#&,state,1],"up",MapAt[#-elt[[2]]&,state,1]]],{0,0,0},#]&;
|
@@ -1,7 +0,0 @@
|
||||
(* ::Package:: *)
|
||||
|
||||
nums=Import[StringJoin[NotebookDirectory[], "/input.txt"],"Table"];
|
||||
|
||||
part1 = 1##&@@Tr[1##&@@@(#/."up"->-"down")]&;
|
||||
|
||||
part2=1##&@@Rest@Fold[Function[{state,elt},Switch[elt[[1]],"forward",state+{0,elt[[2]],state[[1]] elt[[2]]},"down",MapAt[elt[[2]]+#&,state,1],"up",MapAt[#-elt[[2]]&,state,1]]],{0,0,0},#]&;
|
Reference in New Issue
Block a user