Last active
August 29, 2015 14:21
-
-
Save Chris-plus-alphanumericgibberish/af84190f36b59aa83eda to your computer and use it in GitHub Desktop.
dNethack Games-Played Rules
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
def dnethack_tour?(user) | |
anz = repository.adapter.select "select count(distinct race), count(distinct role) from games where user_id = ? and version == 'DNH' and turns >= 1000 and (race in ('Inc','Clo','Dro','Hlf) or role in ('Nob','Pir','Bin','Brd');", user | |
return (anz[0]+anz[1]) == 8 | |
end | |
def dnethack_king?(user) | |
anz = repository.adapter.select "select count(distinct race), count(distinct role) from games where user_id = ? and version == 'DNH' and ascended='t' and (race in ('Inc','Clo','Dro','Hlf) or role in ('Nob','Pir','Bin','Brd');", user | |
return (anz[0]+anz[1]) == 8 | |
end | |
def dnethack_prince?(user) | |
anz = repository.adapter.select "select count(distinct race), count(distinct role) from games where user_id = ? and version == 'DNH' and ascended='t' and (race in ('Inc','Clo','Dro','Hlf) or role in ('Nob','Pir','Bin','Brd');", user | |
return (anz[0]+anz[1]) >= 4 | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment