James-E-A / mentalDarkChess

trustless implementation of Dark Chess
0 stars 0 forks source link

pieces not spotted if moving too quickly #17

Closed James-E-A closed 2 years ago

James-E-A commented 2 years ago

Test case:

1. e2e4,f5f7 2. e4e5,

White's e-pawn literally just ZOOMS past black's f-pawn without getting spotted:

Do you want to play as WHITE (w) or as BLACK (b)?
> b
INFO:root:GOT SEED COMMITMENT: *Gl*Pvkzre36H@)]?CEG30olclya?$6=7#1E4*H1
INFO:root:H(QUERIES): CU*Mzh9H*TrUOCdHdMBU@L=dU]N}#E9u0G&V9+P$
INFO:root:NO CAPTURE BY OPPONENT THIS TURN
r n b q k b n r
p p p p p p p p
. . . . . . . .
? ? ? ? ? ? ? ?
? ? ? ? ? ? ? ?
? ? ? ? ? ? ? ?
? ? ? ? ? ? ? ?
? ? ? ? ? ? ? ?
INFO:root:CHOSE SEED     : 7T%%%uv98>9YRNkpY5{v8.[oZE9Gb9A9=?L3FPfB
INFO:root:SEED COMMITMENT: wYS^CL>}x!38PbFF:2iVpe0/N+F!7{wz[ov-BhJd
INFO:root:PEEKED AT: a6,b6,c6,d6,e6,f6,g6,h6,a7,b7,c7,d7,e7,f7,g7,h7,b8,c8,d8,e8,f8,g8
INFO:root:REVEALED: 
r n b q k b n r
p p p p p p p p
. . . . . . . .
? ? ? ? ? ? ? ?
? ? ? ? ? ? ? ?
? ? ? ? ? ? ? ?
? ? ? ? ? ? ? ?
? ? ? ? ? ? ? ?
MOVE IN UCI FORMAT (e.g. e2e4,f7f5)
> f7f5
r n b q k b n r
p p p p p . p p
. . . . . . . .
? ? ? ? ? p ? ?
? ? ? ? ? ? ? ?
? ? ? ? ? ? ? ?
? ? ? ? ? ? ? ?
? ? ? ? ? ? ? ?
INFO:root:GOT SEED COMMITMENT: ?%v/LhvfKuf-dX5(OGA44H39m15FVK[jww2&?xIB
INFO:root:H(QUERIES): w83CW4hNzSRQg#=2Vq3a*/zWyp8LX:wJJD?f.caJ
INFO:root:NO CAPTURE BY OPPONENT THIS TURN
r n b q k b n r
p p p p p . p p
. . . . . . . .
? ? ? ? ? p ? ?
? ? ? ? ? ? ? ?
? ? ? ? ? ? ? ?
? ? ? ? ? ? ? ?
? ? ? ? ? ? ? ?
INFO:root:CHOSE SEED     : f:I4X^hR/28T/jTt>aod1kfGaz=InP<-w>m*[/Up
INFO:root:SEED COMMITMENT: U^/:JA1!QxjIY-WIBiHcxD/Y6)Y0o9(NG9Km)8TR
INFO:root:PEEKED AT: e4,g4,a6,b6,c6,d6,e6,f6,g6,h6,a7,b7,c7,d7,e7,f7,g7,h7,b8,c8,d8,e8,f8,g8
INFO:root:REVEALED: 
r n b q k b n r
p p p p p . p p
. . . . . . . .
? ? ? ? ? p ? ?
? ? ? ? . ? . ?
? ? ? ? ? ? ? ?
? ? ? ? ? ? ? ?
? ? ? ? ? ? ? ?
James-E-A commented 2 years ago

The fix for this should be players peeking at the end of their own turn, in addition to the start of it, I think

so the timeline should go

  1. White peeks
  2. White moves
  3. White peeks
  4. Black peeks
  5. Black moves
  6. Black peeks
  7. White peeks
  8. White moves
  9. White peeks etc.

the current code misses steps 3, 6, and 9 above

James-E-A commented 2 years ago

Or, a more refined timeline (forward-looking to #3 and #8):