steveagi commited on
Commit
cbec6d0
·
1 Parent(s): f919dbb

fix a bug in prints

Browse files
Files changed (2) hide show
  1. routers/snake.py +5 -5
  2. routers/watermelon.py +5 -5
routers/snake.py CHANGED
@@ -8,29 +8,29 @@ router = APIRouter(prefix=f"/games/{GAME}/nlp", tags=[GAME])
8
 
9
  @router.post("/c")
10
  def create(code: str=Body(), command: str=Body(), result: list=Body(), desc: list=Body()):
11
- print("[GAME]", "c", command, result, desc)
12
  return game_util.op(GAME, code, "c", command, result, desc)
13
 
14
 
15
  @router.post("/r")
16
  def read(code: str=Body(), command: str=Body()):
17
- print("[GAME]", "r", command)
18
  return game_util.op(GAME, code, "r", command)
19
 
20
 
21
  # @router.post("/u")
22
  # def update(code: str=Body(), command: str=Body()):
23
- # print("[GAME]", "u", command)
24
  # return game_util.op(GAME, code, "u", command)
25
 
26
 
27
  @router.post("/d")
28
  def delete(code: str=Body(), command: str=Body()):
29
- print("[GAME]", "d", command)
30
  return game_util.op(GAME, code, "d", command)
31
 
32
 
33
  @router.post("/reset")
34
  def reset(code: str=Body()):
35
- print("[GAME]", "d", "reset")
36
  return game_util.op(GAME, code, "reset", "")
 
8
 
9
  @router.post("/c")
10
  def create(code: str=Body(), command: str=Body(), result: list=Body(), desc: list=Body()):
11
+ print(f"[{GAME}]", "c", command, result, desc)
12
  return game_util.op(GAME, code, "c", command, result, desc)
13
 
14
 
15
  @router.post("/r")
16
  def read(code: str=Body(), command: str=Body()):
17
+ print(f"[{GAME}]", "r", command)
18
  return game_util.op(GAME, code, "r", command)
19
 
20
 
21
  # @router.post("/u")
22
  # def update(code: str=Body(), command: str=Body()):
23
+ # print(f"[{GAME}]", "u", command)
24
  # return game_util.op(GAME, code, "u", command)
25
 
26
 
27
  @router.post("/d")
28
  def delete(code: str=Body(), command: str=Body()):
29
+ print(f"[{GAME}]", "d", command)
30
  return game_util.op(GAME, code, "d", command)
31
 
32
 
33
  @router.post("/reset")
34
  def reset(code: str=Body()):
35
+ print(f"[{GAME}]", "d", "reset")
36
  return game_util.op(GAME, code, "reset", "")
routers/watermelon.py CHANGED
@@ -9,29 +9,29 @@ router = APIRouter(prefix=f"/games/{GAME}/nlp", tags=[GAME])
9
 
10
  @router.post("/c", tags=[GAME])
11
  def create(code: str=Body(), command: str=Body(), result: list=Body(), desc: list=Body()):
12
- print("[GAME]", "c", command, result, desc)
13
  return game_util.op(GAME, code, "c", command, result, desc)
14
 
15
 
16
  @router.post("/r", tags=[GAME])
17
  def read(code: str=Body(), command: str=Body()):
18
- print("[GAME]", "r", command)
19
  return game_util.op(GAME, code, "r", command)
20
 
21
 
22
  # @router.post("/u")
23
  # def update(code: str=Body(), command: str=Body()):
24
- # print("[GAME]", "u", command)
25
  # return game_util.op(GAME, code, "u", command)
26
 
27
 
28
  @router.post("/d")
29
  def delete(code: str=Body(), command: str=Body()):
30
- print("[GAME]", "d", command)
31
  return game_util.op(GAME, code, "d", command)
32
 
33
 
34
  @router.post("/reset")
35
  def reset(code: str=Body()):
36
- print("[GAME]", "d", "reset")
37
  return game_util.op(GAME, code, "reset", "")
 
9
 
10
  @router.post("/c", tags=[GAME])
11
  def create(code: str=Body(), command: str=Body(), result: list=Body(), desc: list=Body()):
12
+ print(f"[{GAME}]", "c", command, result, desc)
13
  return game_util.op(GAME, code, "c", command, result, desc)
14
 
15
 
16
  @router.post("/r", tags=[GAME])
17
  def read(code: str=Body(), command: str=Body()):
18
+ print(f"[{GAME}]", "r", command)
19
  return game_util.op(GAME, code, "r", command)
20
 
21
 
22
  # @router.post("/u")
23
  # def update(code: str=Body(), command: str=Body()):
24
+ # print(f"[{GAME}]", "u", command)
25
  # return game_util.op(GAME, code, "u", command)
26
 
27
 
28
  @router.post("/d")
29
  def delete(code: str=Body(), command: str=Body()):
30
+ print(f"[{GAME}]", "d", command)
31
  return game_util.op(GAME, code, "d", command)
32
 
33
 
34
  @router.post("/reset")
35
  def reset(code: str=Body()):
36
+ print(f"[{GAME}]", "d", "reset")
37
  return game_util.op(GAME, code, "reset", "")