We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e0572f2 commit 7d761dcCopy full SHA for 7d761dc
react_learn/src/main/scala/tutorial/webapp/TutorialApp.scala
@@ -97,6 +97,17 @@ object Game {
97
case Some(s) => "Winner is " + s
98
case None => "Next player: " + {if (state.xIsNext) "X" else "O"}
99
}
100
+ val moves = state.history.zipWithIndex.map{
101
+ case (step, move) => {
102
+ val desc = if (move > 0) "Go to move #%s".format(move) else "Go to game start"
103
+ <.li(
104
+ <.button(
105
+ ^.onClick --> Callback{/* TODO */},
106
+ desc
107
+ )
108
109
+ }
110
111
<.div(
112
^.cls := "game",
113
@@ -106,7 +117,7 @@ object Game {
117
118
^.cls := "game-info",
119
<.div(status),
- <.ol(/* TODO */),
120
+ <.ol(moves.toTagMod),
121
),
122
)
123
0 commit comments