-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbattleDots.yml
25 lines (24 loc) · 1.52 KB
/
battleDots.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
env:
width: 115
height: 25
dbfile: ':memory:'
food_amount: .1
food_char: '.'
player_dir: 'players/*/*.py'
sql:
setup : [ "DROP TABLE IF EXISTS main_game_field",
"CREATE TABLE main_game_field ( X int, Y int, owner_id int, is_flag int default 0);",
"CREATE TABLE owner( owner_id int, name text, what_to_print text);",
"CREATE INDEX gf_o on main_game_field(owner_id)",
"CREATE INDEX own_o on owner(owner_id)",
"CREATE INDEX own_n on owner(name)",
"CREATE TABLE engine_orders( src_x int, src_y int, dst_x int, dst_y int , action text)",
"INSERT into owner values ( 0, 'Food', '.');"
]
place_food: "INSERT INTO main_game_field values ( !!X , !!Y, (select owner_id from owner where name='Food'), FALSE )"
get_all_screen_to_print: "SELECT x, y, what_to_print from main_game_field a, owner b where a.owner_id = b.owner_id"
new_player: "INSERT into owner values ( !!id, '!!name', '!!char')"
set_flag: "INSERT INTO main_game_field values ( !!X , !!Y, (select owner_id from owner where name='!!_name'), TRUE)"
set_initial_pos: "INSERT INTO main_game_field values ( !!X , !!Y, (select owner_id from owner where name='!!_name'), FALSE)"
del_initl_pos: "DELETE from main_game_field where x = !!X and y = !!Y"
get_move_actions: "select src_x , src_y , dst_x, dst_y from engine_orders where abs( src_x - dst_x) <= 1 and abs( src_y - dst_y) <= 1 and dst_x >= 0 and dst_x <= !!max_x and dst_y >= 0 and dst_y <= !!max_y"