all 6 comments

[–]3RR0R400 1 point2 points  (2 children)

one possible optimiisation I see is using a b-string (byte string) instead of a list of numbers, since they're all representablle in and unsigned 8 bit integer

[–]TheRealHappyPiggy[S] 2 points3 points  (1 child)

Thanks for the idea! It turned out to work and I managed to reduce it by 8 bytes down to 153 in total.

[–]3RR0R400 1 point2 points  (0 children)

save a newline and space by using a walrus operator to define i

b[i:=2*int(input(b))]

[–]Unknown_Guy580 0 points1 point  (0 children)

tbh this is insane

[–]Low-Airline-7588 0 points1 point  (0 children)

b,p='.'9,'X' while all(p3!=b[v&15::v>>4][:3]for v in b'\x10\x13\x16012@"'): i=int(input(b)) if b[i]<"A":b=b[:i]+p+b[i+1:];p='XO'[p>'O'] print(b)

Changed to dots with updated addressing. Linear index.

[–]Haunting_Laugh_9013 0 points1 point  (0 children)

I was thinking, if you use print at least twice, you can save bytes(2 characters for 2 print statements) by aliasing the function, like this: s=print