Anooj commited on
Commit
81d825e
1 Parent(s): 878b9a9

add highlights and some more text

Browse files
Files changed (1) hide show
  1. app.jl +7 -4
app.jl CHANGED
@@ -12,7 +12,7 @@ const C = Chess
12
  output::R{String} = ""
13
  input::R{String} = ""
14
  boardstr::R{String} = repr(C.startboarddark())
15
- boardhtml::R{String} = repr(C.MIME.html(C.startboarddark()))
16
  board::R{Board} = C.startboarddark()
17
  end
18
 
@@ -22,7 +22,7 @@ function handlers(model)
22
  model.output[] = model.input[]
23
  model.board[] = C.domove(model.board[!], model.input[!])
24
  model.boardstr[] = repr(model.board[!])
25
- model.boardhtml[] = repr(C.MIME.html(model.board[!]))
26
  model.process[] = false
27
  end
28
  end
@@ -30,14 +30,14 @@ function handlers(model)
30
  if (model.reset[])
31
  model.board[] = C.startboarddark()
32
  model.boardstr[] = repr(model.board[!])
33
- model.boardhtml[] = repr(C.MIME.html(model.board[!]))
34
  model.reset[] = false
35
  end
36
  end
37
  on(model.rollout) do _
38
  if (model.rollout[])
39
  model.board[], _ = ImpCatcher.simulate_rollout(model.board[!], ImpCatcher.CESPF, 0)
40
- model.boardhtml[] = repr(C.MIME.html(model.board[!]))
41
  model.rollout[] = false
42
  end
43
 
@@ -50,6 +50,8 @@ function ui(model)
50
  page(model, class="container", [
51
  h1("Building Dark Chess Engines for SOTA Performance")
52
  h3("By Anooj Patel")
 
 
53
  p([
54
  "Input Move in UCI format (e.g \"d2d4\") == Move(SQ_D2, SQ_D4)"
55
  input("", @bind(:input), @on("keyup.enter", "process = true"))
@@ -63,6 +65,7 @@ function ui(model)
63
  "Last Move Processed"
64
  pre("", @text(:output))
65
  ])
 
66
  span(
67
  var"v-html" = "boardhtml" # magic to summon vue js
68
  )
 
12
  output::R{String} = ""
13
  input::R{String} = ""
14
  boardstr::R{String} = repr(C.startboarddark())
15
+ boardhtml::R{String} = repr(C.MIME.html(C.startboarddark(), highlight=C.visiblesquares(C.startboarddark(),C.moves(C.startboarddark()))))
16
  board::R{Board} = C.startboarddark()
17
  end
18
 
 
22
  model.output[] = model.input[]
23
  model.board[] = C.domove(model.board[!], model.input[!])
24
  model.boardstr[] = repr(model.board[!])
25
+ model.boardhtml[] = repr(C.MIME.html(model.board[!], highlight=C.visiblesquares(model.board[!],C.moves(model.board[!]))))
26
  model.process[] = false
27
  end
28
  end
 
30
  if (model.reset[])
31
  model.board[] = C.startboarddark()
32
  model.boardstr[] = repr(model.board[!])
33
+ model.boardhtml[] = repr(C.MIME.html(model.board[!], highlight=C.visiblesquares(model.board[!],C.moves(model.board[!]))))
34
  model.reset[] = false
35
  end
36
  end
37
  on(model.rollout) do _
38
  if (model.rollout[])
39
  model.board[], _ = ImpCatcher.simulate_rollout(model.board[!], ImpCatcher.CESPF, 0)
40
+ model.boardhtml[] = repr(C.MIME.html(model.board[!], highlight=C.visiblesquares(model.board[!],C.moves(model.board[!]))))
41
  model.rollout[] = false
42
  end
43
 
 
50
  page(model, class="container", [
51
  h1("Building Dark Chess Engines for SOTA Performance")
52
  h3("By Anooj Patel")
53
+
54
+ h5("An Example Dark Chess Game with a Greedy Rollout")
55
  p([
56
  "Input Move in UCI format (e.g \"d2d4\") == Move(SQ_D2, SQ_D4)"
57
  input("", @bind(:input), @on("keyup.enter", "process = true"))
 
65
  "Last Move Processed"
66
  pre("", @text(:output))
67
  ])
68
+ p("Green highlights show what the current player can see")
69
  span(
70
  var"v-html" = "boardhtml" # magic to summon vue js
71
  )