Skip to content

Commit e8eb0a8

Browse files
committed
Comment out all the debug output
1 parent 2b6a711 commit e8eb0a8

File tree

8 files changed

+19
-31
lines changed

8 files changed

+19
-31
lines changed

src/main/scala/ru/org/codingteam/icfpc/Application.scala

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ object Application extends App {
6565
emulator.initSourceWithSeed(seed)
6666
emulator.emulate(commands)
6767
val newScore = emulator.score
68-
println(s"Seed $seed: Maximum old score: $maxOldScore; new score: $newScore")
68+
//println(s"Seed $seed: Maximum old score: $maxOldScore; new score: $newScore")
6969
if (newScore > maxOldScore) {
7070
good += ((seed, maxOldScore, newScore))
7171
}
@@ -76,10 +76,12 @@ object Application extends App {
7676
OutputDef(field.id, seed, tag, Utils.encode(commands))
7777
}
7878
if (!good.isEmpty && mbScores.isDefined) {
79-
println("Better solutions:")
79+
//println("Better solutions:")
80+
/*
8081
good.map(s =>
8182
println(s" Seed ${s._1}: was ${s._2}, new ${s._3}")
8283
)
84+
*/
8385
outs.filter(out => good.map(_._1).contains(out.seed))
8486
} else {
8587
outs

src/main/scala/ru/org/codingteam/icfpc/Emulator.scala

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -346,26 +346,26 @@ class Emulator (val field : Field, phrases: Set[String]) {
346346
}
347347

348348
def emulatorStep(cmd : Command) : StepResult = {
349-
println(s"Execute: $cmd")
349+
//println(s"Execute: $cmd")
350350
val oldUnit = currentUnit
351351
val toLock = executeCommand(cmd)
352352
var gameOver = false
353353
if (toLock) {
354-
println("Unit locked.")
354+
//println("Unit locked.")
355355
lock(oldUnit)
356356
val cleared = field.clearRows()
357357
if (cleared > 0) {
358-
println(s"$cleared rows cleared.")
358+
//println(s"$cleared rows cleared.")
359359
}
360360

361361
moveScore += getMoveScore(oldUnit, cleared)
362362
previousUnitClearedLines = cleared
363363

364364
val nextOk = spawnNextUnit()
365-
println("Spawning next unit:")
365+
//println("Spawning next unit:")
366366
MapPrinter.printUnit(currentUnit)
367367
if (! nextOk) {
368-
println("Game over.")
368+
//println("Game over.")
369369
gameOver = true
370370
}
371371
}
@@ -382,7 +382,7 @@ class Emulator (val field : Field, phrases: Set[String]) {
382382
var count = 0
383383
if (currentUnit == null) {
384384
spawnNextUnit()
385-
println("First unit:")
385+
//println("First unit:")
386386
MapPrinter.printUnit(currentUnit)
387387
}
388388

src/main/scala/ru/org/codingteam/icfpc/MapPrinter.scala

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -27,23 +27,9 @@ object MapPrinter {
2727
}
2828
}
2929

30-
def printMap(fd : FieldDef) : Unit = {
30+
def printMap(fd : FieldDef) : Unit = {}
3131

32-
print2d(fd.filled, fd.width, fd.height, "XXX", None)
33-
34-
for (unit <- fd.units) {
35-
println("\nUnit:")
36-
Utils.getUnitSize(unit) match {
37-
case (width, height) =>
38-
print2d(unit.members, width, height, "UUU", Some(unit.pivot))
39-
}
40-
}
41-
}
42-
43-
def printUnit(unit : UnitDef) : Unit = {
44-
val size = Utils.getUnitSize(unit)
45-
print2d(unit.members, size._1, size._2, "UUU", Some(unit.pivot))
46-
}
32+
def printUnit(unit : UnitDef) : Unit = {}
4733

4834
val testMap : FieldDef =
4935
FieldDef(1,Vector.empty,6,6,

src/main/scala/ru/org/codingteam/icfpc/Strategist.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ object Strategist {
3636

3737
solve(emulator, state_, phrases, commands ++ commands_)
3838
case _ =>
39-
println("!!!Terminated prematurely; please report")
39+
//println("!!!Terminated prematurely; please report")
4040
commands ++ commands_.take(commandCount)
4141
}
4242
}

src/main/scala/ru/org/codingteam/icfpc/Utils.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,10 @@ object Utils {
109109
em.initSource(srcIdx)
110110
val cmds = Utils.decode(commands)
111111
val cmdsCnt = em.emulate(cmds)
112-
println(s"Executed $cmdsCnt commands")
112+
//println(s"Executed $cmdsCnt commands")
113113
print("\n")
114114
em.printField()
115-
println(s"\nScore: ${em.score}")
115+
//println(s"\nScore: ${em.score}")
116116
return em.score
117117
}
118118

src/main/scala/ru/org/codingteam/icfpc/visual/VisualizatorApplication.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import ru.org.codingteam.icfpc.visual.controller.{ReplayController, ManualContro
77

88
object VisualizatorApplication {
99
def main(args: Array[String]): Unit = {
10-
println(args.toList)
10+
//println(args.toList)
1111

1212
val board = new Board
1313
val frame = new JFrame

src/main/scala/ru/org/codingteam/icfpc/visual/controller/ManualController.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,13 @@ class ManualController(visualizator: Visualizator, filePath: String) extends Con
4747
StepResult(false, false)
4848
}
4949
case KeyEvent.VK_P => {
50-
println(Utils.encode(commands.toList))
50+
//println(Utils.encode(commands.toList))
5151
StepResult(false, false)
5252
}
5353
case _ => StepResult(false, false)
5454
}
5555
if (res.gameOver) {
56-
println(Utils.encode(commands.toList))
56+
//println(Utils.encode(commands.toList))
5757
}
5858

5959
visualizator.visualizeState(emulator)

src/test/scala/ru/org/codingteam/icfpc/EmulatorSpec.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class EmulatorSpec extends FlatSpec with Matchers{
3030
val eiei = Stream.continually(ei.toStream).flatten.take(200)
3131

3232
val cmdsCnt = em.emulate(eiei)
33-
println(s"Executed $cmdsCnt commands")
33+
//println(s"Executed $cmdsCnt commands")
3434
print("\n")
3535
em.printField()
3636
}

0 commit comments

Comments
 (0)