Skip to content

Commit

Permalink
Reset page on the ranking script to make the output look nicer
Browse files Browse the repository at this point in the history
  • Loading branch information
ujh committed Jan 3, 2024
1 parent e81368c commit d39fbf1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ranking
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ end

Dir.chdir(experiment_dir) do
loop do
puts "\033[2J\033[H"
generation = latest_generation
Dir.chdir(generation) do
data = JSON.load_file("data.json")
Expand All @@ -43,6 +44,8 @@ Dir.chdir(experiment_dir) do
median_score = median(scores)
average_score = average(scores)

puts "\033[3mGeneration: #{generation} Round: #{data['round']+1}\nMin: #{min_score} Max: #{max_score} Median: #{median_score} Average: #{average_score}\033[0m\n\n"

skipped = false
rankings.each_with_index do |player, i|
external = data['players'][player['name']]['external']
Expand All @@ -63,9 +66,7 @@ Dir.chdir(experiment_dir) do
end
end

puts "\n\033[3mGeneration: #{generation} Round: #{data['round']+1}\nMin: #{min_score} Max: #{max_score} Median: #{median_score} Average: #{average_score}\033[0m"
end
puts "\n\n"
sleep 10
end
end

0 comments on commit d39fbf1

Please sign in to comment.