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