AI Gaming
Search…
Twist Cube
Our reproduction of the well known cube. Can you write the code that will match up all six sides?

Objective

To rearrange each square on the cube so that all of the colours on each side of the cube match.

gamestate

An example of the gamestate JSON
1
{
2
'LeadingSolution': None,
3
'ResponseDeadline': 1544009796770,
4
'IsLeader': False,
5
'IsMover': True,
6
'FRONT': [
7
['Y2', 'O5', 'O2'],
8
['G1', 'G4', 'B3'],
9
['O0', 'O3', 'R8']
10
],
11
'BACK': [
12
['O6', 'Y3', 'R2'],
13
['Y1', 'B4', 'W3'],
14
['W8', 'Y5', 'O8']
15
],
16
'LEFT': [
17
['B0', 'B1', 'G8'],
18
['O1', 'O4', 'W7'],
19
['G6', 'R1', 'W0']
20
],
21
'RIGHT': [
22
['G0', 'Y7', 'Y6'],
23
['R5', 'R4', 'G7'],
24
['B6', 'R3', 'G2']
25
],
26
'UP': [
27
['W2', 'O7', 'B8'],
28
['W1', 'W4', 'B7'],
29
['R6', 'G3', 'W6']
30
],
31
'DOWN': [
32
['B2', 'B5', 'Y8'],
33
['W5', 'Y4', 'G5'],
34
['Y0', 'R7', 'R0']
35
],
36
'GameStatus': 'RUNNING',
37
'GameId': 2398826,
38
'OpponentId': 'housebot-practise'
39
}
Copied!
A description of each of the gamestate fields
Key
Description
LeadingSolution
ResponseDeadline
IsLeader
IsMover
FRONT
BACK
LEFT
RIGHT
UP
DOWN
GameStatus
GameId
OpponentID

Understanding the board

More detail required

Making a valid move

1
["1U'", "1L'", "1D'", "1R'", "1F'", "1L'", '1R', '1F', '1L', '1F', "1B'", "1R'", '1B', "1B'"]
Copied!
More detail required