-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbatalla.py
56 lines (40 loc) · 1.08 KB
/
batalla.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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
def iniciar_tablero(dimension=5):
celda = '˜'
fila = []
for _ in range(dimension):
fila.append(celda)
tablero = []
for _ in range(dimension):
tablero.append(fila)
return tablero
def mostrar_fila(fila):
for celda in fila:
print(celda, end=' ')
print()
def mostrar_tablero(tablero):
fila_abc = 'ABCDEFGHIJKLMNOPQRSTUVXYZ'
dimension = len(tablero)
print(' ', end='')
# for i in range(dimension):
# print(fila_abc[i], end=' ')
# print()
print(' '.join(list(fila_abc[:dimension])))
for i in range(dimension):
if i < 10:
print(' ', end='')
print(i, end=' ')
mostrar_fila(tablero[i])
def posicionar_barco(largo, disposicion, celda_inicial):
# falta un parametro CLAVE!
pass
def disparar(fila, columna):
# toma parametros fila y columna y retorna ???
# falta un parametro CLAVE!
pass
def verificar_hundidos():
pass
tablero = iniciar_tablero()
# mostrar_fila(tablero[0])
mostrar_tablero(tablero)