awacke1 commited on
Commit
9110820
·
1 Parent(s): d3e44c3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -2
app.py CHANGED
@@ -22,10 +22,15 @@ def get_word_score(word, letter_values):
22
 
23
  def display_board(board):
24
  """Display the game board."""
 
 
25
  for i in range(len(board)):
 
26
  for j in range(len(board[i])):
27
- st.write(board[i][j], end=' ')
28
- st.write('\n')
 
 
29
 
30
  # Create the game board
31
  board = np.zeros((15, 15), dtype=int)
 
22
 
23
  def display_board(board):
24
  """Display the game board."""
25
+ headers = [''] + [str(i+1) for i in range(len(board))]
26
+ data = []
27
  for i in range(len(board)):
28
+ row = [chr(i+65)]
29
  for j in range(len(board[i])):
30
+ row.append(chr(board[i][j]))
31
+ data.append(row)
32
+ st.table(data=data, headers=headers)
33
+
34
 
35
  # Create the game board
36
  board = np.zeros((15, 15), dtype=int)