Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions games/__init__.py
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not append into the existing Othello game?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In uwapi, we need to specify if we have winby for the whole game. If I append to the existing othello im forced to use winby

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thats a huge limitation...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep should we fix that before we add othello then? I’m not sure if I’m the right person to fix it

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can tackle Uni and UWAPI changes post finals

Original file line number Diff line number Diff line change
Expand Up @@ -1238,6 +1238,26 @@
supports_win_by=True
),

'othelloblob': Game(
name='Othello Blob',
variants={
'4x4': Variant(
name='4x4 Othello',
data_provider=GamesmanClassic,
data_provider_game_id='othellofour',
data_provider_variant_id=0,
gui='v3'),
'4x5': Variant(
name='4x5 Othello',
data_provider=GamesmanClassic,
data_provider_game_id='othellofourxfive',
data_provider_variant_id=0,
gui='v3')
},
gui='v3',
supports_win_by=False
),

'orbito': Game(
name='Orbito',
variants={
Expand Down
40 changes: 40 additions & 0 deletions games/image_autogui_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -1952,6 +1952,45 @@ def get_othello(variant_id):
}
}


def get_othelloblob(variant_id):
match variant_id:
case '4x5':
centers = [[5 + i % 5 * 10, 5 + i // 5 * 10] for i in range(20)]
char_images = {
"b": {"image": "general/blackpiece.svg", "scale": 9},
"w": {"image": "general/whitepiece.svg", "scale": 9},
"p": {"image": "othello/P.svg", "scale": 9},
}
centers.append([25.06, 45])
centers = [[x + 0.06, y + 0.06] for x, y in centers]
background = "othello5x4/board.svg"
space = [50.12, 50]
case '4x4':
centers = [[5 + i % 4 * 10, 5 + i // 4 * 10] for i in range(16)]
char_images = {
"b": {"image": "general/blackpiece.svg", "scale": 9},
"w": {"image": "general/whitepiece.svg", "scale": 9},
"p": {"image": "othello/P.svg", "scale": 6},
}
centers.append([20, 45])
centers = [[x + 0.06, y + 0.06] for x, y in centers]
background = "othello/grid.svg"
space = [40.12, 50]
return {
"defaultTheme": "regular",
"themes": {
"regular": {
"space": space,
"centers": centers,
"background": background,
"charImages": char_images,
"sounds": {"x": "general/place.mp3"},
"animationType": "entityFade"
}
}
}

def get_pancakes(variant_id):
rows = int(variant_id)
height = 1.25 * rows
Expand Down Expand Up @@ -3049,6 +3088,7 @@ def get_sokoban(variant_id):
"oddoreven": get_oddoreven,
"orbito" : get_orbito,
"othello": get_othello,
"othelloblob": get_othelloblob,
"pancakes": get_pancakes,
"pegsolitaire": get_pegsolitaire,
"ponghauki": get_ponghauki,
Expand Down