-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #339 from domino14/welch
use welch's t-test for stopping condition
- Loading branch information
Showing
8 changed files
with
141 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
local macondo = require("macondo") | ||
|
||
|
||
-- does not work on Windows, I think: | ||
function sleep(n) | ||
os.execute("sleep " .. tonumber(n)) | ||
end | ||
|
||
function dump(o) | ||
if type(o) == 'table' then | ||
local s = '{ ' | ||
for k,v in pairs(o) do | ||
if type(k) ~= 'number' then k = '"'..k..'"' end | ||
s = s .. '['..k..'] = ' .. dump(v) .. ',' | ||
end | ||
return s .. '} ' | ||
else | ||
return tostring(o) | ||
end | ||
end | ||
|
||
|
||
local plays = {} | ||
start_time = os.time() | ||
|
||
for i=1,100 do | ||
macondo.load('cgp 14Q/13GI/9A1B1U1/9C1O1C1/9TUPIK1/9I5/4R4V3OE/3JIBED1E3uH/2LID1WOOSH2T1/3V1A4I2G1/3EFT1cANNULAE/3YAR4T2Z1/4XI3PENNED/5A3ER2DO/7TANSY2L AEINOST/ 378/316 0 lex NWL23;') | ||
local elite_play = macondo.elite_play() | ||
if plays[elite_play] == nil then | ||
plays[elite_play] = 1 | ||
else | ||
plays[elite_play] = plays[elite_play] + 1 | ||
end | ||
print("WINNER ".. elite_play) | ||
end | ||
|
||
end_time = os.time() | ||
elapsed_time = os.difftime(end_time, start_time) | ||
|
||
print(dump(plays)) | ||
print("elapsed_time = " .. elapsed_time) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.