Start working on engine

master
BodgeMaster 2022-11-06 02:23:38 +01:00
parent c8ad44e93e
commit 70456794a4
1 changed files with 45 additions and 20 deletions

View File

@ -17,24 +17,32 @@
import re import re
debug_mode = True debug_mode = False
cursor_up = 'Λ' def debug_message(text):
cursor_down = 'V' if debug_mode:
cursor_left = '<' print("DEBUG: ", end="")
cursor_right = '>' print(text)
empty_field = [
" ________________ ", cursor_north = 'Λ'
"| |", cursor_south = 'V'
"| |", cursor_west = '<'
"| |", cursor_east = '>'
"| |",
"| |", cursor_current = ' '
"| |",
"| |", field = [
"| |", " _________________ ",
" ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ " "| |",
"| |",
"| |",
"| |",
"| |",
"| |",
"| |",
"| |",
" ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ "
] ]
wall = '#' wall = '#'
@ -43,11 +51,28 @@ goal = '$'
cursor_position = [0, 0] cursor_position = [0, 0]
def clear_field():
field = [
" _________________ ",
"| |",
"| |",
"| |",
"| |",
"| |",
"| |",
"| |",
"| |",
" ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ "
]
def debug_message(text): def draw_field():
if debug_mode: for row in range(len(field)):
print("DEBUG: ", end="") for column in range(len(field[row])):
print(text) if column==cursor_position[0] and row==cursor_position[1]:
print(cursor_current, end="")
else:
print(field[row][column], end="")
print("")
def condition_in_front_of_wall(inverted): def condition_in_front_of_wall(inverted):
return False return False