@OathOfCode/

Map Testing

Python

No description

fork
loading
Files
  • main.py
main.py
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
26
27
28
world = ['-','-','-','-',
		'-','-','-','-',
		'-','-','-','-',
		'-','-','-','-']


# _ , | = borders

obj = ['W', 'T', 'O']
def display_board():
	print('_________')
	print('|' + world[0] + ' ' + world[1] + ' ' + world[2] + ' ' + world[3] + '|')
	print('|' + world[4] + ' ' + world[5] + ' ' + world[6] + ' ' + world[7] + '|')
	print('|' + world[8] + ' ' + world[9] + ' ' + world[10] + ' ' + world[11] + '|')
	print('|' + world[12] + ' ' + world[13] + ' ' + world[14] + ' ' + world[15] + '|')
	print('|_______|')

def move():
	if world[0] == obj or world[1] == obj or world[2] == obj or world[3] == obj or world[4] == obj or world[5] == obj or world[6] == obj or world[7] == obj or world[8] == obj or world[9] == obj or world[10] == obj or world[11] == obj or world[12] == obj or world[13] == obj or world[14] == obj or world[15] == obj:
		pass
	position = int(input('Where do you wish to move 1 - 15: '))
	position = position - 1
	world[position] = '@'


while True:
	display_board()
	move()