add picasso writeup

Signed-off-by: Julien CLEMENT <julien.clement@epita.fr>
This commit is contained in:
juju committed 2023-05-04 00:57:11 +02:00
1 parent 01057cae54
commit 8dcf9f9a82
6 files changed
+160 -37

No files matched your search

Binary file not shown.

After

Width:  |  Height:  |  Size: 77 KiB

-1
View File
@@ -186,7 +186,6 @@ fn solve() {
board.solve();
println!("{:x?}", board.moves);
println!("{}", board.moves.len())
}
fn main() {
+55
View File
@@ -0,0 +1,55 @@
#!/usr/bin/env python3
import os
alphabet = b"abcdefghjklmnpqrstuvwxyz"
moves = [
('g', 2),
('o', 3),
('g', 3),
('b', 2),
('y', 2),
('g', 3),
('w', 1),
('o', 3),
('r', 3),
('y', 1),
('r', 3),
('w', 1),
('b', 1),
('o', 2),
('g', 1),
('y', 2),
('g', 1),
('y', 2),
('r', 2),
('g', 2),
('w', 2),
('o', 2),
]
sequence = b""
def face_id(face):
res = 0
if face == 'w':
res = 2
if face == 'b':
res = 4
if face == 'o':
res = 1
if face == 'r':
res = 0
if face == 'y':
res = 3
if face == 'g':
res = 5
return res
for move in moves:
i = face_id(move[0]) * 4 + move[1]
sequence += alphabet[i].to_bytes(1, "little")
os.write(1, sequence + b'\n')
Binary file not shown.

After

Width:  |  Height:  |  Size: 79 KiB

Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.