Skip to content

Commit

Permalink
Fix the displaying of evaluation.
Browse files Browse the repository at this point in the history
  • Loading branch information
PenguinCabinet committed Jan 16, 2022
1 parent a764249 commit 31ef938
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 9 deletions.
18 changes: 13 additions & 5 deletions CLI_main.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package main

import "fmt"
import (
"fmt"
"time"
)

func CLI_main() {
benchmark_running = true
Expand All @@ -9,11 +12,16 @@ func CLI_main() {
go benchmark()
var temp_chan_data chan_t
for benchmark_running {
select {
case temp_chan_data = <-chan_data:
fmt.Printf("\r Score:%f Area:%f", temp_chan_data.score, temp_chan_data.S)
default:
L2:
for {
select {
case temp_chan_data = <-chan_data:

default:
break L2
}
}
fmt.Printf("\r Score:%f Area:%f", temp_chan_data.score, temp_chan_data.S)
time.Sleep(time.Millisecond * 100)
}
}
11 changes: 7 additions & 4 deletions GUI_main.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,14 @@ func (g *Game) Draw(screen *ebiten.Image) {
go benchmark()
}
}
select {
case g.temp_chan_data = <-chan_data:
L1:
for {
select {
case g.temp_chan_data = <-chan_data:

default:
//screen.Fill(color.RGBA{255, 255, 255, 0xff})
default:
break L1
}
}
g.Init()
screen.Fill(color.RGBA{255, 255, 255, 0xff})
Expand Down

0 comments on commit 31ef938

Please sign in to comment.