Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try to cheat by a global counter #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tarao
Copy link
Owner

@tarao tarao commented Dec 16, 2018

Attempt to use a global counter will be blocked by these lines:

prisoners-switch/main.go

Lines 49 to 56 in 73787e5

for i := 0; i < totalGames; i++ {
g := game.NewMotalGame(&game.Logger{
Game: fmt.Sprintf("#%d", i+len(fairGames)+1),
LogLevel: logLevel,
Writer: os.Stderr,
})
games = append(games, g)
}

Without these lines, the verifier cannot reject this solution and reports a quite high score
> verifier/run
[Game #29] SUCCESS in 1675 steps with no switch
[Game #33] SUCCESS in 1314 steps with no switch
[Game #95] SUCCESS in 1707 steps with no switch
[Game #31] SUCCESS in 1154 steps with no switch
[Game #58] SUCCESS in 1893 steps with no switch
[Game #30] SUCCESS in 1232 steps with no switch
[Game #94] SUCCESS in 1139 steps with no switch
[Game #59] SUCCESS in 2194 steps with no switch
[Game #74] SUCCESS in 1629 steps with no switch
[Game #34] SUCCESS in 1508 steps with no switch
[Game #90] SUCCESS in 1240 steps with no switch
[Game #72] SUCCESS in 1718 steps with no switch
[Game #24] SUCCESS in 1726 steps with no switch
[Game #68] SUCCESS in 2140 steps with no switch
[Game #82] SUCCESS in 1972 steps with no switch
[Game #16] SUCCESS in 1443 steps with no switch
[Game #46] SUCCESS in 1324 steps with no switch
[Game #67] SUCCESS in 3251 steps with no switch
[Game #28] SUCCESS in 1594 steps with no switch
[Game #78] SUCCESS in 1633 steps with no switch
[Game #38] SUCCESS in 1486 steps with no switch
[Game #53] SUCCESS in 1385 steps with no switch
[Game #43] SUCCESS in 1768 steps with no switch
[Game #5] SUCCESS in 1738 steps with no switch
[Game #42] SUCCESS in 2024 steps with no switch
[Game #65] SUCCESS in 1558 steps with no switch
[Game #63] SUCCESS in 1795 steps with no switch
[Game #3] SUCCESS in 1586 steps with no switch
[Game #50] SUCCESS in 1422 steps with no switch
[Game #39] SUCCESS in 2059 steps with no switch
[Game #23] SUCCESS in 1340 steps with no switch
[Game #54] SUCCESS in 1292 steps with no switch
[Game #48] SUCCESS in 1309 steps with no switch
[Game #61] SUCCESS in 1620 steps with no switch
[Game #62] SUCCESS in 1444 steps with no switch
[Game #100] SUCCESS in 1257 steps with no switch
[Game #44] SUCCESS in 1170 steps with no switch
[Game #21] SUCCESS in 2303 steps with no switch
[Game #45] SUCCESS in 3743 steps with no switch
[Game #9] SUCCESS in 1359 steps with no switch
[Game #17] SUCCESS in 1289 steps with no switch
[Game #99] SUCCESS in 870 steps with no switch
[Game #36] SUCCESS in 1023 steps with no switch
[Game #83] SUCCESS in 1655 steps with no switch
[Game #60] SUCCESS in 1735 steps with no switch
[Game #13] SUCCESS in 1420 steps with no switch
[Game #71] SUCCESS in 1661 steps with no switch
[Game #80] SUCCESS in 2415 steps with no switch
[Game #6] SUCCESS in 1394 steps with no switch
[Game #11] SUCCESS in 1477 steps with no switch
[Game #19] SUCCESS in 1753 steps with no switch
[Game #91] SUCCESS in 939 steps with no switch
[Game #92] SUCCESS in 1700 steps with no switch
[Game #55] SUCCESS in 1671 steps with no switch
[Game #70] SUCCESS in 1629 steps with no switch
[Game #56] SUCCESS in 1263 steps with no switch
[Game #27] SUCCESS in 1305 steps with no switch
[Game #88] SUCCESS in 1517 steps with no switch
[Game #87] SUCCESS in 1595 steps with no switch
[Game #96] SUCCESS in 1412 steps with no switch
[Game #73] SUCCESS in 942 steps with no switch
[Game #69] SUCCESS in 1627 steps with no switch
[Game #1] SUCCESS in 1059 steps with no switch
[Game #40] SUCCESS in 1757 steps with no switch
[Game #52] SUCCESS in 2806 steps with no switch
[Game #86] SUCCESS in 1417 steps with no switch
[Game #76] SUCCESS in 2229 steps with no switch
[Game #8] SUCCESS in 1663 steps with no switch
[Game #47] SUCCESS in 2252 steps with no switch
[Game #51] SUCCESS in 2313 steps with no switch
[Game #41] SUCCESS in 1751 steps with no switch
[Game #4] SUCCESS in 1670 steps with no switch
[Game #37] SUCCESS in 1524 steps with no switch
[Game #64] SUCCESS in 2494 steps with no switch
[Game #84] SUCCESS in 2008 steps with no switch
[Game #32] SUCCESS in 1401 steps with no switch
[Game #12] SUCCESS in 1678 steps with no switch
[Game #14] SUCCESS in 6594 steps with no switch
[Game #35] SUCCESS in 1573 steps with no switch
[Game #85] SUCCESS in 1918 steps with no switch
[Game #98] SUCCESS in 1350 steps with no switch
[Game #97] SUCCESS in 1910 steps with no switch
[Game #89] SUCCESS in 1225 steps with no switch
[Game #20] SUCCESS in 1126 steps with no switch
[Game #26] SUCCESS in 1326 steps with no switch
[Game #49] SUCCESS in 1476 steps with no switch
[Game #75] SUCCESS in 1652 steps with no switch
[Game #10] SUCCESS in 1144 steps with no switch
[Game #15] SUCCESS in 1255 steps with no switch
[Game #25] SUCCESS in 1368 steps with no switch
[Game #57] SUCCESS in 1321 steps with no switch
[Game #22] SUCCESS in 1429 steps with no switch
[Game #79] SUCCESS in 1514 steps with no switch
[Game #81] SUCCESS in 1452 steps with no switch
[Game #77] SUCCESS in 2507 steps with no switch
[Game #7] SUCCESS in 1498 steps with no switch
[Game #93] SUCCESS in 1665 steps with no switch
[Game #66] SUCCESS in 1463 steps with no switch
[Game #2] SUCCESS in 1990 steps with no switch
[Game #18] SUCCESS in 1707 steps with no switch
I [2018-12-16T21:40:41+09:00 #29861] run.result : [Score] 198320
I [2018-12-16T21:40:41+09:00 #29861] run.result : [Steps] 167984
I [2018-12-16T21:40:41+09:00 #29861] run.result : [Used switches] 0
I [2018-12-16T21:40:41+09:00 #29861] run.result : All game passed

@tarao tarao added the sample label Dec 16, 2018
@tarao tarao changed the title Try to cheat by a global counter. Try to cheat by a global counter Dec 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant