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