mirror of
https://github.com/open-thought/reasoning-gym.git
synced 2026-04-27 17:23:19 +00:00
refactor: add more docstrings and examples to tsumego
This commit is contained in:
parent
9887a1beed
commit
faaede6e8d
3 changed files with 239 additions and 135 deletions
231
GALLERY.md
231
GALLERY.md
|
|
@ -308,21 +308,21 @@ difficulty = 1
|
|||
Example tasks:
|
||||
````
|
||||
Example 1:
|
||||
Question: This is a BF (Brainf*ck) computer program. What is the output?
|
||||
Question: This is a BF (Brainf*ck) computer program. What is the output?
|
||||
|
||||
>[-]>[-]<>++++++++++[<+++++++++++>-]<+.-.+++++.--------------.+++++++++++++++.<
|
||||
Answer: onset
|
||||
Metadata: {'bfit_code': '\nint main() {\n print("onset");\n}\n', 'bf_program': '>[-]>[-]<>++++++++++[<+++++++++++>-]<+.-.+++++.--------------.+++++++++++++++.<'}
|
||||
|
||||
Example 2:
|
||||
Question: This is a BF (Brainf*ck) computer program. What is the output?
|
||||
Question: This is a BF (Brainf*ck) computer program. What is the output?
|
||||
|
||||
>[-]>[-]<>++++++++[<++++++++++++++>-]<.-----------.+++++++++++++.---------------.+++++.<
|
||||
Answer: perch
|
||||
Metadata: {'bfit_code': '\nint main() {\n print("perch");\n}\n', 'bf_program': '>[-]>[-]<>++++++++[<++++++++++++++>-]<.-----------.+++++++++++++.---------------.+++++.<'}
|
||||
|
||||
Example 3:
|
||||
Question: This is a BF (Brainf*ck) computer program. What is the output?
|
||||
Question: This is a BF (Brainf*ck) computer program. What is the output?
|
||||
|
||||
>[-]>[-]<>+++++++++[<+++++++++++++>-]<.-------.----------.+.+++++++++++++.<
|
||||
Answer: under
|
||||
|
|
@ -672,14 +672,14 @@ Example tasks:
|
|||
Example 1:
|
||||
Question: Please read the following figlet font:
|
||||
|
||||
sSSSs d s b sss. d sss sss sssss
|
||||
S S S S S d S S
|
||||
S S S SS Y S S
|
||||
S S S S ss. S sSSs S
|
||||
S S S S b S S
|
||||
S S S S P S S
|
||||
"sss" P P ` ss' P sSSss P
|
||||
|
||||
sSSSs d s b sss. d sss sss sssss
|
||||
S S S S S d S S
|
||||
S S S SS Y S S
|
||||
S S S S ss. S sSSs S
|
||||
S S S S b S S
|
||||
S S S S P S S
|
||||
"sss" P P ` ss' P sSSss P
|
||||
|
||||
|
||||
Answer: ONSET
|
||||
Metadata: {'font': 'amc_tubes', 'space_letters': True}
|
||||
|
|
@ -687,14 +687,14 @@ Metadata: {'font': 'amc_tubes', 'space_letters': True}
|
|||
Example 2:
|
||||
Question: What word does this say?
|
||||
|
||||
###### ###### ###### #### ## ##
|
||||
## ## ## ## ## ## ## ## ## ##
|
||||
## ## ## ## ## ## ## ## ##
|
||||
##### #### ##### ## ######
|
||||
## ## ## ## ## ## ## ##
|
||||
## ## ## ## ## ## ## ## ##
|
||||
#### ###### ### ### #### ## ##
|
||||
|
||||
###### ###### ###### #### ## ##
|
||||
## ## ## ## ## ## ## ## ## ##
|
||||
## ## ## ## ## ## ## ## ##
|
||||
##### #### ##### ## ######
|
||||
## ## ## ## ## ## ## ##
|
||||
## ## ## ## ## ## ## ## ##
|
||||
#### ###### ### ### #### ## ##
|
||||
|
||||
|
||||
Answer: PERCH
|
||||
Metadata: {'font': 'demo_2__', 'space_letters': True}
|
||||
|
|
@ -702,17 +702,17 @@ Metadata: {'font': 'demo_2__', 'space_letters': True}
|
|||
Example 3:
|
||||
Question: What word does this say?
|
||||
|
||||
|
||||
|
||||
|
||||
### ### ### ### ##### ###### #####
|
||||
## ## ## # ## ## ## # ## ##
|
||||
## ## ### # ## ## #### ## ##
|
||||
## ## ##### ## ## ## ####
|
||||
## ## ## ## ## ## ## ## ## ##
|
||||
### ### ## ##### ###### #### ##
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
### ### ### ### ##### ###### #####
|
||||
## ## ## # ## ## ## # ## ##
|
||||
## ## ### # ## ## #### ## ##
|
||||
## ## ##### ## ## ## ####
|
||||
## ## ## ## ## ## ## ## ## ##
|
||||
### ### ## ##### ###### #### ##
|
||||
|
||||
|
||||
|
||||
Answer: UNDER
|
||||
Metadata: {'font': 'xcourb', 'space_letters': True}
|
||||
|
|
@ -1975,16 +1975,16 @@ Example tasks:
|
|||
Example 1:
|
||||
Question: You are given a 3x3x3 Rubik's cube. It looks like this:
|
||||
|
||||
G Y G
|
||||
G Y G
|
||||
G R G
|
||||
W W W O G O Y Y Y R B R
|
||||
R R R W G W O O O Y B Y
|
||||
R R R W G W O O O Y B Y
|
||||
B O B
|
||||
B W B
|
||||
B W B
|
||||
|
||||
G Y G
|
||||
G Y G
|
||||
G R G
|
||||
W W W O G O Y Y Y R B R
|
||||
R R R W G W O O O Y B Y
|
||||
R R R W G W O O O Y B Y
|
||||
B O B
|
||||
B W B
|
||||
B W B
|
||||
|
||||
|
||||
Please provide a solution to solve this cube using Singmaster notation.
|
||||
Answer: None
|
||||
|
|
@ -1993,16 +1993,16 @@ Metadata: {'cube_size': 3, 'scramble_steps': 3, 'scramble_moves': "F L' R", 'exa
|
|||
Example 2:
|
||||
Question: You are given a 3x3x3 Rubik's cube. It looks like this:
|
||||
|
||||
Y Y R
|
||||
Y Y R
|
||||
G G R
|
||||
B B Y R R B W W W G O O
|
||||
R R W G G G Y O O B B Y
|
||||
R R W G G G Y O O B B Y
|
||||
O O O
|
||||
B W W
|
||||
B W W
|
||||
|
||||
Y Y R
|
||||
Y Y R
|
||||
G G R
|
||||
B B Y R R B W W W G O O
|
||||
R R W G G G Y O O B B Y
|
||||
R R W G G G Y O O B B Y
|
||||
O O O
|
||||
B W W
|
||||
B W W
|
||||
|
||||
|
||||
Please provide a solution to solve this cube using Singmaster notation.
|
||||
Answer: None
|
||||
|
|
@ -2011,16 +2011,16 @@ Metadata: {'cube_size': 3, 'scramble_steps': 3, 'scramble_moves': "L' F U'", 'ex
|
|||
Example 3:
|
||||
Question: You are given a 3x3x3 Rubik's cube. It looks like this:
|
||||
|
||||
Y Y W
|
||||
Y Y W
|
||||
Y Y W
|
||||
G G G O O B O O O G R R
|
||||
R R R G G B O O O G B B
|
||||
R R R G G R B B B O B B
|
||||
W W Y
|
||||
W W Y
|
||||
W W Y
|
||||
|
||||
Y Y W
|
||||
Y Y W
|
||||
Y Y W
|
||||
G G G O O B O O O G R R
|
||||
R R R G G B O O O G B B
|
||||
R R R G G R B B B O B B
|
||||
W W Y
|
||||
W W Y
|
||||
W W Y
|
||||
|
||||
|
||||
Please provide a solution to solve this cube using Singmaster notation.
|
||||
Answer: None
|
||||
|
|
@ -2041,7 +2041,7 @@ size = 500
|
|||
Example tasks:
|
||||
````
|
||||
Example 1:
|
||||
Question: Given the truthfulness of these statements, please tell me the number of possible solutions:
|
||||
Question: Given the truthfulness of these statements, please tell me the number of possible solutions:
|
||||
- Statement 1: 'At least 1 of these 7 statements are true.'
|
||||
- Statement 2: 'At most 3 of these 7 statements are false.'
|
||||
- Statement 3: 'Exactly 4 of these 7 statements are true.'
|
||||
|
|
@ -2053,7 +2053,7 @@ Question: Given the truthfulness of these statements, please tell me the number
|
|||
Answer: 4
|
||||
|
||||
Example 2:
|
||||
Question: Given the truthfulness of these statements, please tell me the number of possible solutions:
|
||||
Question: Given the truthfulness of these statements, please tell me the number of possible solutions:
|
||||
- Statement 1: 'At least 4 of these 7 statements are true.'
|
||||
- Statement 2: 'At most 5 of these 7 statements are false.'
|
||||
- Statement 3: 'Exactly 7 of these 7 statements are true.'
|
||||
|
|
@ -2065,7 +2065,7 @@ Question: Given the truthfulness of these statements, please tell me the number
|
|||
Answer: 4
|
||||
|
||||
Example 3:
|
||||
Question: Given the truthfulness of these statements, please tell me the number of possible solutions:
|
||||
Question: Given the truthfulness of these statements, please tell me the number of possible solutions:
|
||||
- Statement 1: 'At least 2 of these 7 statements are true.'
|
||||
- Statement 2: 'At most 5 of these 7 statements are false.'
|
||||
- Statement 3: 'Exactly 0 of these 7 statements are true.'
|
||||
|
|
@ -2245,13 +2245,13 @@ $ - A box on a goal
|
|||
Your solution must be a string of characters, ex: LDURRUDL.
|
||||
|
||||
Here is your puzzle:
|
||||
+ + + + + + + + +
|
||||
+ + X - @ * @ X +
|
||||
+ + + - - @ - + +
|
||||
+ + + - - - X $ +
|
||||
+ + + + - + + + +
|
||||
+ + $ + + + + + +
|
||||
+ + + + + + + + +
|
||||
+ + + + + + + + +
|
||||
+ + X - @ * @ X +
|
||||
+ + + - - @ - + +
|
||||
+ + + - - - X $ +
|
||||
+ + + + - + + + +
|
||||
+ + $ + + + + + +
|
||||
+ + + + + + + + +
|
||||
|
||||
|
||||
Answer: RLDULLRRDLDR
|
||||
|
|
@ -2271,14 +2271,14 @@ $ - A box on a goal
|
|||
Your solution must be a string of characters, ex: LDURRUDL.
|
||||
|
||||
Here is your puzzle:
|
||||
+ + + + + +
|
||||
+ - * - - +
|
||||
+ @ - - @ +
|
||||
+ X - @ - +
|
||||
+ - - - X +
|
||||
+ X - @ X +
|
||||
+ - - - - +
|
||||
+ + + + + +
|
||||
+ + + + + +
|
||||
+ - * - - +
|
||||
+ @ - - @ +
|
||||
+ X - @ - +
|
||||
+ - - - X +
|
||||
+ X - @ X +
|
||||
+ - - - - +
|
||||
+ + + + + +
|
||||
|
||||
|
||||
Answer: LDRRDRDDLLURURDULUURDD
|
||||
|
|
@ -2298,16 +2298,16 @@ $ - A box on a goal
|
|||
Your solution must be a string of characters, ex: LDURRUDL.
|
||||
|
||||
Here is your puzzle:
|
||||
+ + + + + + + + + + + +
|
||||
+ - $ - X + - - - - - +
|
||||
+ - @ - - - - - @ - X +
|
||||
+ - * - @ - - X - $ - +
|
||||
+ - - - - X + - - - - +
|
||||
+ + - - - - + $ - @ - +
|
||||
+ + + - - - - - - - - +
|
||||
+ + + - - - $ - - - - +
|
||||
+ + + + - - - - - - - +
|
||||
+ + + + + + + + + + + +
|
||||
+ + + + + + + + + + + +
|
||||
+ - $ - X + - - - - - +
|
||||
+ - @ - - - - - @ - X +
|
||||
+ - * - @ - - X - $ - +
|
||||
+ - - - - X + - - - - +
|
||||
+ + - - - - + $ - @ - +
|
||||
+ + + - - - - - - - - +
|
||||
+ + + - - - $ - - - - +
|
||||
+ + + + - - - - - - - +
|
||||
+ + + + + + + + + + + +
|
||||
|
||||
|
||||
Answer: RRRRURRRLDDRRDLULDRDLLLLULLDRDRUULUUULDLLURRDRU
|
||||
|
|
@ -2578,32 +2578,31 @@ Metadata: {'num_disks': 6, 'num_pegs': 3, 'start_peg': 1, 'target_peg': 2, 'auxi
|
|||
````
|
||||
|
||||
### tsumego
|
||||
Generates Tsumego problems with configurable parameters
|
||||
Generates (one-move) Tsumego problems with configurable parameters
|
||||
|
||||
Default configuration:
|
||||
```python
|
||||
min_board_size = 9
|
||||
max_board_size = 13
|
||||
max_stones = 15
|
||||
size = 100
|
||||
size = 10
|
||||
seed = 42
|
||||
```
|
||||
|
||||
Example tasks:
|
||||
````
|
||||
Example 1:
|
||||
Question: Tsumego time. Black to play and capture some stones.
|
||||
Find the key move.
|
||||
Question: I have a Go problem for you. Black moves next - can you capture some of the white stones?
|
||||
|
||||
A B C D E F G H I
|
||||
9 X . . . X . . . .
|
||||
8 . . . . . . . . .
|
||||
7 . O . O . . X . .
|
||||
6 . . . . . . . . O
|
||||
5 O . . O . . . . .
|
||||
4 . X O O . . . . .
|
||||
3 . . . O . . . . .
|
||||
2 . . . . . . . . .
|
||||
6 . . . X . . . . O
|
||||
5 O . X O X . . . .
|
||||
4 . X O O . O . . .
|
||||
3 . . X O X . . . .
|
||||
2 . . . X . . . . .
|
||||
1 . O . O . . X . .
|
||||
|
||||
X - Black
|
||||
|
|
@ -2611,18 +2610,20 @@ O - White
|
|||
|
||||
Specify your move in coordinates (e.g. 'C4' for column C, row 4)
|
||||
Answer: E4
|
||||
Metadata: {'difficulty': {'board_size': 9}, 'board': [['X', '.', '.', '.', 'X', '.', '.', '.', '.'], ['.', '.', '.', '.', '.', '.', '.', '.', '.'], ['.', 'O', '.', 'O', '.', '.', 'X', '.', '.'], ['.', '.', '.', '.', '.', '.', '.', '.', 'O'], ['O', '.', '.', 'O', '.', '.', '.', '.', '.'], ['.', 'X', 'O', 'O', '.', '.', '.', '.', '.'], ['.', '.', '.', 'O', '.', '.', '.', '.', '.'], ['.', '.', '.', '.', '.', '.', '.', '.', '.'], ['.', 'O', '.', 'O', '.', '.', 'X', '.', '.']], 'solution': (5, 4)}
|
||||
|
||||
Metadata: {'difficulty': {'board_size': 9}, 'board': [['X', '.', '.', '.', 'X', '.', '.', '.', '.'], ['.', '.', '.', '.', '.', '.', '.', '.', '.'], ['.', 'O', '.', 'O', '.', '.', 'X', '.', '.'], ['.', '.', '.', 'X', '.', '.', '.', '.', 'O'], ['O', '.', 'X', 'O', 'X', '.', '.', '.', '.'], ['.', 'X', 'O', 'O', '.', 'O', '.', '.', '.'], ['.', '.', 'X', 'O', 'X', '.', '.', '.', '.'], ['.', '.', '.', 'X', '.', '.', '.', '.', '.'], ['.', 'O', '.', 'O', '.', '.', 'X', '.', '.']], 'solution': 'E4'}
|
||||
|
||||
--------------------------------------------------
|
||||
|
||||
Example 2:
|
||||
Question: Tsumego time. Black to play and capture some stones.
|
||||
Find the key move.
|
||||
Question: Here's a Go challenge. Playing as Black, how can you capture as many white stones as possible?
|
||||
|
||||
A B C D E F G H I
|
||||
9 . . O . . . . . .
|
||||
8 . X O . . . . . .
|
||||
7 . . . O . . . . .
|
||||
6 . . O O . . . . .
|
||||
5 . . O O . . . . .
|
||||
7 X . X . . . . . .
|
||||
6 O O O X . . . . .
|
||||
5 X O O . . . . . .
|
||||
4 . X . . . . . . O
|
||||
3 . X . . . . X . .
|
||||
2 O . O . . . . . .
|
||||
|
|
@ -2632,8 +2633,11 @@ X - Black
|
|||
O - White
|
||||
|
||||
Specify your move in coordinates (e.g. 'C4' for column C, row 4)
|
||||
Answer: E6
|
||||
Metadata: {'difficulty': {'board_size': 9}, 'board': [['.', '.', 'O', '.', '.', '.', '.', '.', '.'], ['.', 'X', 'O', '.', '.', '.', '.', '.', '.'], ['.', '.', '.', 'O', '.', '.', '.', '.', '.'], ['.', '.', 'O', 'O', '.', '.', '.', '.', '.'], ['.', '.', 'O', 'O', '.', '.', '.', '.', '.'], ['.', 'X', '.', '.', '.', '.', '.', '.', 'O'], ['.', 'X', '.', '.', '.', '.', 'X', '.', '.'], ['O', '.', 'O', '.', '.', '.', '.', '.', '.'], ['.', '.', '.', '.', 'O', '.', '.', '.', '.']], 'solution': (3, 4)}
|
||||
Answer: B7
|
||||
|
||||
Metadata: {'difficulty': {'board_size': 9}, 'board': [['.', '.', 'O', '.', '.', '.', '.', '.', '.'], ['.', 'X', 'O', '.', '.', '.', '.', '.', '.'], ['X', '.', 'X', '.', '.', '.', '.', '.', '.'], ['O', 'O', 'O', 'X', '.', '.', '.', '.', '.'], ['X', 'O', 'O', '.', '.', '.', '.', '.', '.'], ['.', 'X', '.', '.', '.', '.', '.', '.', 'O'], ['.', 'X', '.', '.', '.', '.', 'X', '.', '.'], ['O', '.', 'O', '.', '.', '.', '.', '.', '.'], ['.', '.', '.', '.', 'O', '.', '.', '.', '.']], 'solution': 'B7'}
|
||||
|
||||
--------------------------------------------------
|
||||
|
||||
Example 3:
|
||||
Question: Tsumego time. Black to play and capture some stones.
|
||||
|
|
@ -2645,11 +2649,11 @@ Find the key move.
|
|||
10 . . . . . . . . . . . .
|
||||
9 . . . . . . . . . . . .
|
||||
8 X . . . . X . . . X . .
|
||||
7 . X . . . . . O . . . .
|
||||
6 . . . . . . O O . . . O
|
||||
5 . . . . . . . O . . . .
|
||||
4 . O . . . . . . O . . O
|
||||
3 X . . . . . . . . . . .
|
||||
7 . X . . . . . . . . . .
|
||||
6 . O X X . . . . . . . O
|
||||
5 . X O O X . . . . . . .
|
||||
4 . O O . . . . . O . . O
|
||||
3 X . X . . . . . . . . .
|
||||
2 . . . . . . . . . . . .
|
||||
1 . . . . . . . . . . X .
|
||||
|
||||
|
|
@ -2657,8 +2661,9 @@ X - Black
|
|||
O - White
|
||||
|
||||
Specify your move in coordinates (e.g. 'C4' for column C, row 4)
|
||||
Answer: I6
|
||||
Metadata: {'difficulty': {'board_size': 12}, 'board': [['.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.'], ['.', '.', 'X', '.', '.', '.', '.', '.', '.', '.', '.', '.'], ['.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.'], ['.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.'], ['X', '.', '.', '.', '.', 'X', '.', '.', '.', 'X', '.', '.'], ['.', 'X', '.', '.', '.', '.', '.', 'O', '.', '.', '.', '.'], ['.', '.', '.', '.', '.', '.', 'O', 'O', '.', '.', '.', 'O'], ['.', '.', '.', '.', '.', '.', '.', 'O', '.', '.', '.', '.'], ['.', 'O', '.', '.', '.', '.', '.', '.', 'O', '.', '.', 'O'], ['X', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.'], ['.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.'], ['.', '.', '.', '.', '.', '.', '.', '.', '.', '.', 'X', '.']], 'solution': (6, 8)}
|
||||
Answer: D4
|
||||
|
||||
Metadata: {'difficulty': {'board_size': 12}, 'board': [['.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.'], ['.', '.', 'X', '.', '.', '.', '.', '.', '.', '.', '.', '.'], ['.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.'], ['.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.'], ['X', '.', '.', '.', '.', 'X', '.', '.', '.', 'X', '.', '.'], ['.', 'X', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.'], ['.', 'O', 'X', 'X', '.', '.', '.', '.', '.', '.', '.', 'O'], ['.', 'X', 'O', 'O', 'X', '.', '.', '.', '.', '.', '.', '.'], ['.', 'O', 'O', '.', '.', '.', '.', '.', 'O', '.', '.', 'O'], ['X', '.', 'X', '.', '.', '.', '.', '.', '.', '.', '.', '.'], ['.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.'], ['.', '.', '.', '.', '.', '.', '.', '.', '.', '.', 'X', '.']], 'solution': 'D4'}
|
||||
|
||||
````
|
||||
|
||||
|
|
@ -2839,5 +2844,3 @@ Answer: carol
|
|||
Metadata: {'num_people': 4, 'num_characteristics': 4}
|
||||
|
||||
````
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue