d5-py: bonehead on data copy-paste
parent
67130ccc37
commit
c0912bcc1e
|
@ -15,6 +15,7 @@
|
|||
'';
|
||||
py_pkgs = [ pkgs.python310 ];
|
||||
lua_pkgs = [ (pkgs.lua.withPackages (luapkgs: [ luapkgs.busted luapkgs.luafilesystem ])) ];
|
||||
fennel_pkgs = [];
|
||||
in
|
||||
{
|
||||
# Jack of all trades
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
[D]
|
||||
[D]
|
||||
[N] [C]
|
||||
[Z] [M] [P]
|
||||
1 2 3
|
||||
|
|
|
@ -17,6 +17,7 @@ class MoveInsn:
|
|||
def part1(crates: list[list[str]], insns: list[MoveInsn]) -> str:
|
||||
for move in insns:
|
||||
for _ in range(move.how_many):
|
||||
# print(crates)
|
||||
crates[move.to_crate - 1].append(crates[move.from_crate - 1].pop())
|
||||
return "".join([crate[-1] for crate in crates])
|
||||
|
||||
|
@ -75,3 +76,4 @@ if __name__ == "__main__":
|
|||
import sys
|
||||
with open(sys.argv[1], "r") as f:
|
||||
main(f)
|
||||
|
||||
|
|
Loading…
Reference in New Issue