1
0
Fork 0
python-chess running in Cartesi RISC-V virtual machine.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
server c9aa75a6c3 GPLv3+ 8 months ago
cartesi-python-chess-cartesi-img print board 8 months ago
.gitignore ignore vim 8 months ago
LICENSE.txt GPLv3+ 8 months ago
README.md GPLv3+ 8 months ago
build-cartesi-cartesi-python-chess python-chess on cartesi 8 months ago
cartesi-buildroot-config python-chess on cartesi 8 months ago
do-all-cartesi-python-chess python-chess on cartesi 8 months ago
edit-mntfs-cartesi-cartesi-python-chess python-chess on cartesi 8 months ago
edit-rootfs-cartesi-cartesi-python-chess python-chess on cartesi 8 months ago
run-cartesi-cartesi-python-chess python-chess on cartesi 8 months ago

README.md

Cartesi python-chess

Crufty scripts to build disk images to run under the Cartesi RISC-V machine emulator that verify a chess game. Similar to the Cartesi example, but this is in python using python-chess, not javascript.

Output

Good PGN

cartesi-python-chess$ ./build-cartesi-cartesi-python-chess ; ./run-cartesi-cartesi-python-chess 
copying from directory cartesi-python-chess-cartesi-img

         .
        / \
      /    \
\---/---\  /----\
 \       X       \
  \----/  \---/---\
       \    / CARTESI
        \ /   MACHINE
         '

+ /mnt/cartesi-python-chess/python-chess-validate.py
[Event "Grand Slam Final Masters"]
[Site "Bilbao ESP"]
[Date "2010.10.11"]
[Round "3"]
[White "Shirov, Alexei"]
[Black "Carlsen, Magnus"]
[Result "1/2-1/2"]
[BlackElo "2826"]
[BlackFideId "1503014"]
[BlackTitle "GM"]
[ECO "C95"]
[EventDate "2010.10.09"]
[EventType "DRR"]
[Opening "Ruy Lopez"]
[Variation "closed, Breyer, Borisenko variation"]
[WhiteElo "2749"]
[WhiteFideId "2209390"]
[WhiteTitle "GM"]

1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Be7 6. Re1 b5 7. Bb3 d6 8. c3 O-O 9. h3 Nb8 10. d4 Nbd7 11. Nbd2 Bb7 12. Bc2 Re8 13. a4 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 100. Qb6 Bc4 101. Qd4 Be6 102. Kf1 Bf5 103. Kg1 g4 104. hxg4 Bxg4 105. Qc3 Bf5 106. Qb3 Bg5 107. Kf1 Kh6 108. Kg1 Kg6 109. Kf1 Bd7 110. Kg1 Be8 111. Qc3 Bf7 112. Qe5 Bd5 113. Qc3 Be6 114. Qe5 Bd7 115. Qc3 Bf5 116. Qb3 Nh5 117. Qg8+ Ng7 118. Qb3 Ne6 119. Kh2 Bf6 120. Kg1 Bg7 121. Kf1 Ng5 122. Qb6+ Bf6 123. Kg1 h3 124. gxh3 Bxh3 125. Qd6 Bf5 126. Kg2 Nf3 127. Qd5 Kg5 128. Qg8+ Bg6 129. Qd5+ Be5 130. Qd8+ Kh5 131. Qd5 Bf5 132. Qf7+ Kg4 133. Qg8+ Ng5 134. Qc4 Bf4 135. Qg8 Be6 136. Qg7 Bf7 137. Qd4 Kf5 138. Qc5+ Be5 139. Qf8 Kg6 140. Qc5 Bf6 141. Qd6 Bc4 142. Qc6 Be6 143. Qd6 Bg4 144. Qd5 Bf3+ 145. Kf1 Nf7 146. Kg1 Ne5 147. Qg8+ Kf5 148. Qc8+ Kg5 149. Qg8+ Ng6 150. Qd5+ Kh6 151. Qe6 Be5 152. Qf5 Bf4 153. Qf6 Bg5 154. Qe6 Kg7 155. Qd7+ Ne7 156. Qe6 Bf6 157. Kf1 Kg6 158. Kg1 Nf5 159. Qg8+ Kh5 160. Qf7+ Kg5 161. Qg8+ Kf4 162. Qb8+ Kg4 163. Qg8+ Bg5 164. Qc8 Bf6 165. Qg8+ Kf4 166. Qb8+ Be5 167. Qb4 Nd4 168. Qf8+ Kg5 169. Qg8+ Kh6 170. Qf8+ Bg7 171. Qd6+ Kh5 172. Qh2+ Kg5 173. Qg3+ Bg4 174. Qe3+ Kf5 1/2-1/2
Errors: []
+ exit

Halted
Cycles: 1393531108

Illegal PGN

cartesi-python-chess$ ./build-cartesi-cartesi-python-chess  ; ./run-cartesi-cartesi-python-chess 
copying from directory cartesi-python-chess-cartesi-img

         .
        / \
      /    \
\---/---\  /----\
 \       X       \
  \----/  \---/---\
       \    / CARTESI
        \ /   MACHINE
         '

+ /mnt/cartesi-python-chess/python-chess-validate.py
[Event "Grand Slam Final Masters"]
[Site "Bilbao ESP"]
[Date "2010.10.11"]
[Round "3"]
[White "Shirov, Alexei"]
[Black "Carlsen, Magnus"]
[Result "1/2-1/2"]
[BlackElo "2826"]
[BlackFideId "1503014"]
[BlackTitle "GM"]
[ECO "C95"]
[EventDate "2010.10.09"]
[EventType "DRR"]
[Opening "Ruy Lopez"]
[Variation "closed, Breyer, Borisenko variation"]
[WhiteElo "2749"]
[WhiteFideId "2209390"]
[WhiteTitle "GM"]

1. e4 e5 2. Nf3 1/2-1/2
Errors: [ValueError("illegal san: 'Nc8' in rnbqkbnr/pppp1ppp/8/4p3/4P3/5N2/PPPP1PPP/RNBQKB1R b KQkq - 1 2")]
+ exit

Halted
Cycles: 1104508408

Upstream

Python Chess

Cartesi

Copying

GPLv3+.

Contact

y@deepcrayon.fish or jebba/jebbam on discord/lichess/etc.