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
15 changes: 15 additions & 0 deletions games/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,21 @@
},
gui='v3'),

'chipschallenge': Game(
name="Chip\'s Challenge",
variants= {
"1": Variant(
name="Level 1",
data_provider=GamesmanPy,
data_provider_game_id='chipschallenge',
data_provider_variant_id="1",
gui='v3'
),
},
is_two_player_game=False,
gui='v3'
),

'chomp': Game(
name='Chomp',
variants={
Expand Down
47 changes: 47 additions & 0 deletions games/image_autogui_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,52 @@ def get_chinesechess(variant_id):
}
}


def get_chipschallenge(variant_id):

"""
Tiles for future reference: https://wiki.bitbusters.club/Tile
"""

match variant_id:
case "1":
row_size = 15
column_size = 14

board_size = [row_size*20, column_size*20]
centers = [[17.75 + 15.5626*x, 7.75 + 15.5625*y] for y in range(0, column_size) for x in range(row_size)]


return {
"defaultTheme": "regular",
"themes": {
"regular": {
"space": board_size,
"centers": centers,
"background": f"chipschallenge/board.svg",
"charImages": {
"W" : {"image": f"chipschallenge/wall.svg", "scale": 15},
"." : {"image": f"chipschallenge/floor.svg", "scale": 15},
"c" : {"image": f"chipschallenge/computer_chip.svg", "scale": 15},
"P" : {"image": f"chipschallenge/exit.svg", "scale": 15},
"B" : {"image": f"chipschallenge/blue_lock.svg", "scale": 15},
"R" : {"image": f"chipschallenge/red_lock.svg", "scale": 15},
"y" : {"image": f"chipschallenge/yellow_key.svg", "scale": 15},
"p" : {"image": f"chipschallenge/ox.svg", "scale": 30},
"b" : {"image": f"chipschallenge/blue_key.svg", "scale": 15},
"r" : {"image": f"chipschallenge/red_key.svg", "scale": 15},
"g" : {"image": f"chipschallenge/green_key.svg", "scale": 15},
"G" : {"image": f"chipschallenge/green_lock.svg", "scale": 15},
"Y" : {"image": f"chipschallenge/yellow_lock.svg", "scale": 15},
"C" : {"image": f"chipschallenge/socket.svg", "scale": 12},
},
"arrowWidth": 0.5,
"sounds": {"x": "general/slide.mp3"}
}
}
}


def get_chomp(variant_id):
rows, cols = variant_id.split('x')
rows, cols = int(rows), int(cols)
Expand Down Expand Up @@ -2752,6 +2798,7 @@ def get_orbito(variant_id):
"change": get_change,
"chess": get_chess,
"chinesechess": get_chinesechess,
"chipschallenge": get_chipschallenge,
"chomp": get_chomp,
"chopsticks": get_chopsticks,
"clobber": get_clobber,
Expand Down
2 changes: 2 additions & 0 deletions server.py
Copy link
Member

Choose a reason for hiding this comment

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

unstage

Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ def key_move_obj_by_move_value_then_delta_remoteness(move_obj):
return (VALUES.index(move_value), delta_remotenesss)

def wrangle_move_objects_1Player(position_data):

if 'remoteness' not in position_data: # Means not possible to solve puzzle from this state
position_data['remoteness'] = Remoteness.INFINITY
current_position_remoteness = position_data['remoteness']
Expand All @@ -43,6 +44,7 @@ def wrangle_move_objects_1Player(position_data):
# Moves that reduce remoteness should be green. Moves that increase remoteness should
# be red. Moves that neither reduce nor increase remoteness should be yellow.
move_obj['moveValue'] = Value.WIN if delta_remoteness > 0 else Value.LOSE if delta_remoteness < 0 else Value.TIE

move_objs.sort(key=key_move_obj_by_move_value_then_delta_remoteness)

def wrangle_move_objects_2Player(position_data):
Expand Down