From 70456794a4490fedffb2fe96c9bbc0aaa958b02a Mon Sep 17 00:00:00 2001 From: BodgeMaster <> Date: Sun, 6 Nov 2022 02:23:38 +0100 Subject: [PATCH] Start working on engine --- lambdaV.py | 65 +++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 45 insertions(+), 20 deletions(-) diff --git a/lambdaV.py b/lambdaV.py index 3728f95..4e43b36 100644 --- a/lambdaV.py +++ b/lambdaV.py @@ -17,24 +17,32 @@ 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 = [ + " _________________ ", + "| |", + "| |", + "| |", + "| |", + "| |", + "| |", + "| |", + "| |", + " ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ " ] 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