SanaomerUnity commited on
Commit
d4b473f
·
verified ·
1 Parent(s): 1fedbb8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -19,8 +19,11 @@ def greet(original_string):
19
  b = backgammon.Backgammon(part1, part2)
20
 
21
  # Generate plays and return moves
22
- for play in b.generate_plays():
23
- return play.moves # Ensure play.moves is a string
 
 
 
24
 
25
  # Ensure the inputs and outputs match what `greet` returns
26
  demo = gr.Interface(fn=greet, inputs="text", outputs="text")
 
19
  b = backgammon.Backgammon(part1, part2)
20
 
21
  # Generate plays and return moves
22
+ moves = [play.moves for play in b.generate_plays()]
23
+ if not moves: # If no moves are generated
24
+ return "No moves available."
25
+
26
+ return moves[0] # Return the first move as an example
27
 
28
  # Ensure the inputs and outputs match what `greet` returns
29
  demo = gr.Interface(fn=greet, inputs="text", outputs="text")