diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0d20b64 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.pyc diff --git a/cards.py b/cards.py index d4d46c6..78b56d0 100644 --- a/cards.py +++ b/cards.py @@ -1,655 +1,657 @@ def wcards(): return [ - "A Gypsy curse.", - "A moment of silence.", - "A sausage festival.", - "An honest cop with nothing left to lose.", - "Famine.", - "Flesh-eating bacteria.", - "Flying sex snakes.", - "Not giving a shit about the Third World.", - "Sexting.", - "Shapeshifters.", - "Porn stars.", - "Raping and pillaging.", - "72 virgins.", - "A drive-by shooting.", - "A time travel paradox.", - "Authentic Mexican cuisine.", - "Bling.", - "Consultants.", - "Crippling debt.", - "Daddy issues.", - "The Donald Trump Seal of Approval.", - "Dropping a chandelier on your enemies and riding the rope up.", - "Former President George W. Bush.", - "Full frontal nudity.", - "Hormone injections.", - "Laying an egg.", - "Getting naked and watching Nickelodeon.", - "Pretending to care.", - "Public ridicule.", - "Sharing needles.", - "Boogers.", - "The inevitable heat death of the universe.", - "The miracle of childbirth.", - "The Rapture.", - "Whipping it out.", - "White privilege.", - "Wifely duties.", - "The Hamburglar.", - "AXE Body Spray.", - "The Blood of Christ.", - "Horrifying laser hair removal accidents.", - "BATMAN!!!", - "Agriculture.", - "A robust mongoloid.", - "Natural selection.", - "Coat hanger abortions.", - "Eating all of the cookies before the AIDS bake-sale.", - "Michelle Obama's arms.", - "The World of Warcraft.", - "Swooping.", - "Obesity.", - "A homoerotic volleyball montage.", - "Lockjaw.", - "A mating display.", - "Testicular torsion.", - "All-you-can-eat shrimp for $4.99.", - "Domino's Oreo Dessert Pizza.", - "Kanye West.", - "Hot cheese.", - "Raptor attacks.", - "Taking off your shirt.", - "Smegma.", - "Alcoholism.", - "A middle-aged man on roller skates.", - "The Care Bear Stare.", - "Bingeing and purging.", - "Oversized lollipops.", - "Self-loathing.", - "Children on leashes.", - "Half-assed foreplay.", - "The Holy Bible.", - "German dungeon porn.", - "Being on fire.", - "Teenage pregnancy.", - "Gandhi.", - "Leaving an awkward voicemail.", - "Uppercuts.", - "Customer service representatives.", - "An erection that lasts longer than four hours.", - "My genitals.", - "Picking up girls at the abortion clinic.", - "Science.", - "Not reciprocating oral sex.", - "Flightless birds.", - "A good sniff.", - "Waterboarding.", - "A balanced breakfast.", - "Historically black colleges.", - "Actually taking candy from a baby.", - "The Make-A-Wish Foundation.", - "A clandestine butt scratch.", - "Passive-aggressive Post-it notes.", - "The Chinese gymnastics team.", - "Switching to Geico.", - "Peeing a little bit.", - "Home video of Oprah sobbing into a Lean Cuisine.", - "Nocturnal emissions.", - "The Jews.", - "My humps.", - "Powerful thighs.", - "Winking at old people.", - "Mr. Clean, right behind you.", - "A gentle caress of the inner thigh.", - "Sexual tension.", - "The forbidden fruit.", - "Skeletor.", - "Fancy Feast.", - "Being rich.", - "Sweet, sweet vengeance.", - "Republicans.", - "A gassy antelope.", - "Natalie Portman.", - "Copping a feel.", - "Kamikaze pilots.", - "Sean Connery.", - "The homosexual agenda.", - "The hardworking Mexican.", - "A falcon with a cap on its head.", - "Altar boys.", - "The Kool-Aid Man.", - "Getting so angry that you pop a boner.", - "Free samples.", - "A big hoopla about nothing.", - "Doing the right thing.", - "The Three-Fifths compromise.", - "Lactation.", - "World peace.", - "RoboCop.", - "Chutzpah.", - "Justin Bieber.", - "Oompa-Loompas.", - "Inappropriate yodeling.", - "Puberty.", - "Ghosts.", - "An asymmetric boob job.", - "Vigorous jazz hands.", - "Fingering.", - "Glenn Beck catching his scrotum on a curtain hook.", - "GoGurt.", - "Police brutality.", - "John Wilkes Booth.", - "Preteens.", - "Scalping.", - "Stifling a giggle at the mention of Hutus and Tutsis.", - "\"Tweeting.\"", - "Darth Vader.", - "A sad handjob.", - "Exactly what you'd expect.", - "Expecting a burp and vomiting on the floor.", - "Adderall.", - "Embryonic stem cells.", - "Tasteful sideboob.", - "Panda sex.", - "An icepick lobotomy.", - "Tom Cruise.", - "Mouth herpes.", - "Sperm whales.", - "Homeless people.", - "Third base.", - "Incest.", - "Pac-Man uncontrollably guzzling cum.", - "A mime having a stroke.", - "Hulk Hogan.", - "God.", - "Scrubbing under the folds.", - "Golden showers.", - "Emotions.", - "Licking things to claim them as your own.", - "Pabst Blue Ribbon.", - "The placenta.", - "Spontaneous human combustion.", - "Friends with benefits.", - "Finger painting.", - "Old-people smell.", - "Dying of dysentery.", - "My inner demons.", - "A Super Soaker full of cat pee.", - "Aaron Burr.", - "Cuddling.", - "The chronic.", - "Cockfights.", - "Friendly fire.", - "Ronald Reagan.", - "A disappointing birthday party.", - "A sassy black woman.", - "Mathletes.", - "A tiny horse.", - "William Shatner.", - "Riding off into the sunset.", - "An M. Night Shyamalan plot twist.", - "Jew-fros.", - "Mutually-assured destruction.", - "Pedophiles.", - "Yeast.", - "Grave robbing.", - "Eating the last known bison.", - "Catapults.", - "Poor people.", - "Forgetting the Alamo.", - "The Hustle.", - "The Force.", - "Wiping her butt.", - "Intelligent design.", - "Loose lips.", - "AIDS.", - "Pictures of boobs.", - "The Ubermensch.", - "Sarah Palin.", - "American Gladiators.", - "Getting really high.", - "Scientology.", - "Penis envy.", - "Praying the gay away.", - "Frolicking.", - "Two midgets shitting into a bucket.", - "The KKK.", - "Genghis Khan.", - "Crystal meth.", - "Serfdom.", - "Stranger danger.", - "A Bop It.", - "Shaquille O'Neal's acting career.", - "Prancing.", - "Vigilante justice.", - "Overcompensation.", - "Pixelated bukkake.", - "A lifetime of sadness.", - "Racism.", - "Dwarf tossing.", - "Sunshine and rainbows.", - "A monkey smoking a cigar.", - "Flash flooding.", - "Lance Armstrong's missing testicle.", - "Dry heaving.", - "The terrorists.", - "Britney Spears at 55.", - "Attitude.", - "Breaking out into song and dance.", - "Leprosy.", - "Gloryholes.", - "Nipple blades.", - "The heart of a child.", - "Puppies!", - "Waking up half-naked in a Denny's parking lot.", - "Dental dams.", - "Toni Morrison's vagina.", - "The taint; the grundle; the fleshy fun-bridge.", - "Active listening.", - "Ethnic cleansing.", - "The Little Engine That Could.", - "The invisible hand.", - "Waiting 'til marriage.", - "Unfathomable stupidity.", - "Euphoria by Calvin Klein.", - "Re-gifting.", - "Autocannibalism.", - "Erectile dysfunction.", - "My collection of high-tech sex toys.", - "The Pope.", - "White people.", - "Tentacle porn.", - "Glenn Beck convulsively vomiting as a brood of crab spiders hatches in his brain and erupts from his tear ducts.", - "Too much hair gel.", - "Seppuku.", - "Same-sex ice dancing.", - "Cheating in the Special Olympics.", - "Charisma.", - "Keanu Reeves.", - "Sean Penn.", - "Nickelback.", - "A look-see.", - "Pooping back and forth. Forever.", - "Menstruation.", - "Kids with ass cancer.", - "A salty surprise.", - "The South.", - "The violation of our most basic human rights.", - "YOU MUST CONSTRUCT ADDITIONAL PYLONS.", - "Date rape.", - "Being fabulous.", - "Necrophilia.", - "Centaurs.", - "Bill Nye the Science Guy.", - "Black people.", - "Chivalry.", - "Lunchables.", - "Bitches.", - "The profoundly handicapped.", - "Heartwarming orphans.", - "MechaHitler.", - "Fiery poops.", - "Another goddamn vampire movie.", - "Tangled Slinkys.", - "The true meaning of Christmas.", - "Estrogen.", - "A zesty breakfast burrito.", - "That thing that electrocutes your abs.", - "Passing a kidney stone.", - "A bleached asshole.", - "Michael Jackson.", - "Cybernetic enhancements.", - "Guys who don't call.", - "Smallpox blankets.", - "Masturbation.", - "Classist undertones.", - "Queefing.", - "Concealing a boner.", - "Edible underpants.", - "Viagra.", - "Soup that is too hot.", - "Muhammad (Praise Be Unto Him).", - "Surprise sex!", - "Five-Dollar Footlongs.", - "Drinking alone.", - "Dick fingers.", - "Multiple stab wounds.", - "Soiling oneself.", - "Child abuse.", - "Anal beads.", - "Civilian casualties.", - "Pulling out.", - "Robert Downey, Jr.", - "Horse meat.", - "A really cool hat.", - "Kim Jong-il.", - "A stray pube.", - "Jewish fraternities.", - "The token minority.", - "Doin' it in the butt.", - "Feeding Rosie O'Donnell.", - "Teaching a robot to love.", - "A can of whoop-ass.", - "A windmill full of corpses.", - "Count Chocula.", - "Wearing underwear inside-out to avoid doing laundry.", - "A death ray.", - "The glass ceiling.", - "A cooler full of organs.", - "The American Dream.", - "Keg stands.", - "When you fart and a little bit comes out.", - "Take-backsies.", - "Dead babies.", - "Foreskin.", - "Saxophone solos.", - "Italians.", - "A fetus.", - "Firing a rifle into the air while balls deep in a squealing hog.", - "Dick Cheney.", - "Amputees.", - "Eugenics.", - "My relationship status.", - "Christopher Walken.", - "Bees?", - "Harry Potter erotica.", - "College.", - "Getting drunk on mouthwash.", - "Nazis.", - "8 oz. of sweet Mexican black-tar heroin.", - "Stephen Hawking talking dirty.", - "Dead parents.", - "Object permanence.", - "Opposable thumbs.", - "Racially-biased SAT questions.", - "Jibber-jabber.", - "Chainsaws for hands.", - "Nicolas Cage.", - "Child beauty pageants.", - "Explosions.", - "Sniffing glue.", - "Glenn Beck being harried by a swarm of buzzards.", - "Repression.", - "Roofies.", - "My vagina.", - "Assless chaps.", - "A murder most foul.", - "Giving 110 percent.", - "Her Royal Highness, Queen Elizabeth II.", - "The Trail of Tears.", - "Being marginalized.", - "Goblins.", - "Hope.", - "The Rev. Dr. Martin Luther King, Jr.", - "A micropenis.", - "My soul.", - "A hot mess.", - "Vikings.", - "Hot people.", - "Seduction.", - "An Oedipus complex.", - "Geese.", - "Global warming.", - "New Age music.", - "Hot Pockets.", - "Making a pouty face.", - "Vehicular manslaughter.", - "Women's suffrage.", - "A defective condom.", - "Judge Judy.", - "African children.", - "The Virginia Tech Massacre.", - "Barack Obama.", - "Asians who aren't good at math.", - "Elderly Japanese men.", - "Exchanging pleasantries.", - "Heteronormativity.", - "Parting the Red Sea.", - "Arnold Schwarzenegger.", - "Road head.", - "Spectacular abs.", - "Figgy pudding.", - "A mopey zoo lion.", - "A bag of magic beans.", - "Poor life choices.", - "My sex life.", - "Auschwitz.", - "A snapping turtle biting the tip of your penis.", - "A thermonuclear detonation.", - "The clitoris.", - "The Big Bang.", - "Land mines.", - "Friends who eat all the snacks.", - "Goats eating cans.", - "The Dance of the Sugar Plum Fairy.", - "Jerking off into a pool of children's tears.", - "Man meat.", - "Me time.", - "The Underground Railroad.", - "Poorly-timed Holocaust jokes.", - "A sea of troubles.", - "Lumberjack fantasies.", - "Morgan Freeman's voice.", - "Women in yogurt commercials.", - "Natural male enhancement.", - "Being a motherfucking sorcerer.", - "Genital piercings.", - "Passable transvestites.", - "Sexy pillow fights.", - "Balls.", - "Grandma.", - "Friction.", - "Party poopers.", - "Farting and walking away.", - "Being a dick to children.", - "Booby-trapping the house to foil burglars.", - "The Tempur-Pedic Swedish Sleep System.", - "Dying.", - "Hurricane Katrina.", - "The gays.", - "The folly of man.", - "Men.", - "The Amish.", - "Pterodactyl eggs.", - "Team-building exercises.", - "A brain tumor.", - "Cards Against Humanity.", - "Fear itself.", - "Lady Gaga.", - "The milk man.", - "A foul mouth.", - "A big black dick.", - "A beached whale.", - "A bloody pacifier.", - "A crappy little hand.", - "A low standard of living.", - "A nuanced critique.", - "Panty raids.", - "A passionate Latino lover.", - "A rival dojo.", - "A web of lies.", - "A woman scorned.", - "Clams.", - "Apologizing.", - "Appreciative snapping.", - "Neil Patrick Harris.", - "Beating your wives.", - "Being a dinosaur.", - "Shaft.", - "Bosnian chicken farmers.", - "Nubile slave boys.", - "Carnies.", - "Coughing into a vagina.", - "Suicidal thoughts.", - "Dancing with a broom.", - "Deflowering the princess.", - "Dorito breath.", - "Eating an albino.", - "Enormous Scandinavian women.", - "Fabricating statistics.", - "Finding a skeleton.", - "Gandalf.", - "Genetically engineered super-soldiers.", - "George Clooney's musk.", - "Getting abducted by Peter Pan.", - "Getting in her pants, politely.", - "Gladiatorial combat.", - "Good grammar.", - "Hipsters.", - "Historical revisionism.", - "Insatiable bloodlust.", - "Jafar.", - "Jean-Claude Van Damme.", - "Just the tip.", - "Mad hacky-sack skills.", - "Leveling up.", - "Literally eating shit.", - "Making the penises kiss.", - "Media coverage.", - "Medieval Times Dinner and Tournament.", - "Moral ambiguity.", - "My machete.", - "One thousand Slim Jims.", - "Ominous background music.", - "Overpowering your father.", - "Pistol-whipping a hostage.", - "Quiche.", - "Quivering jowls.", - "Revenge fucking.", - "Ripping into a man's chest and pulling out his still-beating heart.", - "Ryan Gosling riding in on a white horse.", - "Santa Claus.", - "Scrotum tickling.", - "Sexual humiliation.", - "Sexy Siamese twins.", - "Slow motion.", - "Space muffins.", - "Statistically validated stereotypes.", - "Sudden Poop Explosion Disease.", - "The boners of the elderly.", - "The economy.", - "The Fanta girls.", - "The Gulags.", - "The harsh light of day.", - "The hiccups.", - "The shambling corpse of Larry King.", - "The four arms of Vishnu.", - "Being a busy adult with many important things to do.", - "Tripping balls.", - "Words, words, words.", - "Zeus's sexual appetites.", -] + "A Gypsy curse.", + "A moment of silence.", + "A sausage festival.", + "An honest cop with nothing left to lose.", + "Famine.", + "Flesh-eating bacteria.", + "Flying sex snakes.", + "Not giving a shit about the Third World.", + "Sexting.", + "Shapeshifters.", + "Porn stars.", + "Raping and pillaging.", + "72 virgins.", + "A drive-by shooting.", + "A time travel paradox.", + "Authentic Mexican cuisine.", + "Bling.", + "Consultants.", + "Crippling debt.", + "Daddy issues.", + "The Donald Trump Seal of Approval.", + "Dropping a chandelier on your enemies and riding the rope up.", + "Former President George W. Bush.", + "Full frontal nudity.", + "Hormone injections.", + "Laying an egg.", + "Getting naked and watching Nickelodeon.", + "Pretending to care.", + "Public ridicule.", + "Sharing needles.", + "Boogers.", + "The inevitable heat death of the universe.", + "The miracle of childbirth.", + "The Rapture.", + "Whipping it out.", + "White privilege.", + "Wifely duties.", + "The Hamburglar.", + "AXE Body Spray.", + "The Blood of Christ.", + "Horrifying laser hair removal accidents.", + "BATMAN!!!", + "Agriculture.", + "A robust mongoloid.", + "Natural selection.", + "Coat hanger abortions.", + "Eating all of the cookies before the AIDS bake-sale.", + "Michelle Obama's arms.", + "The World of Warcraft.", + "Swooping.", + "Obesity.", + "A homoerotic volleyball montage.", + "Lockjaw.", + "A mating display.", + "Testicular torsion.", + "All-you-can-eat shrimp for $4.99.", + "Domino's Oreo Dessert Pizza.", + "Kanye West.", + "Hot cheese.", + "Raptor attacks.", + "Taking off your shirt.", + "Smegma.", + "Alcoholism.", + "A middle-aged man on roller skates.", + "The Care Bear Stare.", + "Bingeing and purging.", + "Oversized lollipops.", + "Self-loathing.", + "Children on leashes.", + "Half-assed foreplay.", + "The Holy Bible.", + "German dungeon porn.", + "Being on fire.", + "Teenage pregnancy.", + "Gandhi.", + "Leaving an awkward voicemail.", + "Uppercuts.", + "Customer service representatives.", + "An erection that lasts longer than four hours.", + "My genitals.", + "Picking up girls at the abortion clinic.", + "Science.", + "Not reciprocating oral sex.", + "Flightless birds.", + "A good sniff.", + "Waterboarding.", + "A balanced breakfast.", + "Historically black colleges.", + "Actually taking candy from a baby.", + "The Make-A-Wish Foundation.", + "A clandestine butt scratch.", + "Passive-aggressive Post-it notes.", + "The Chinese gymnastics team.", + "Switching to Geico.", + "Peeing a little bit.", + "Home video of Oprah sobbing into a Lean Cuisine.", + "Nocturnal emissions.", + "The Jews.", + "My humps.", + "Powerful thighs.", + "Winking at old people.", + "Mr. Clean, right behind you.", + "A gentle caress of the inner thigh.", + "Sexual tension.", + "The forbidden fruit.", + "Skeletor.", + "Fancy Feast.", + "Being rich.", + "Sweet, sweet vengeance.", + "Republicans.", + "A gassy antelope.", + "Natalie Portman.", + "Copping a feel.", + "Kamikaze pilots.", + "Sean Connery.", + "The homosexual agenda.", + "The hardworking Mexican.", + "A falcon with a cap on its head.", + "Altar boys.", + "The Kool-Aid Man.", + "Getting so angry that you pop a boner.", + "Free samples.", + "A big hoopla about nothing.", + "Doing the right thing.", + "The Three-Fifths compromise.", + "Lactation.", + "World peace.", + "RoboCop.", + "Chutzpah.", + "Justin Bieber.", + "Oompa-Loompas.", + "Inappropriate yodeling.", + "Puberty.", + "Ghosts.", + "An asymmetric boob job.", + "Vigorous jazz hands.", + "Fingering.", + "Glenn Beck catching his scrotum on a curtain hook.", + "GoGurt.", + "Police brutality.", + "John Wilkes Booth.", + "Preteens.", + "Scalping.", + "Stifling a giggle at the mention of Hutus and Tutsis.", + "\"Tweeting.\"", + "Darth Vader.", + "A sad handjob.", + "Exactly what you'd expect.", + "Expecting a burp and vomiting on the floor.", + "Adderall.", + "Embryonic stem cells.", + "Tasteful sideboob.", + "Panda sex.", + "An icepick lobotomy.", + "Tom Cruise.", + "Mouth herpes.", + "Sperm whales.", + "Homeless people.", + "Third base.", + "Incest.", + "Pac-Man uncontrollably guzzling cum.", + "A mime having a stroke.", + "Hulk Hogan.", + "God.", + "Scrubbing under the folds.", + "Golden showers.", + "Emotions.", + "Licking things to claim them as your own.", + "Pabst Blue Ribbon.", + "The placenta.", + "Spontaneous human combustion.", + "Friends with benefits.", + "Finger painting.", + "Old-people smell.", + "Dying of dysentery.", + "My inner demons.", + "A Super Soaker full of cat pee.", + "Aaron Burr.", + "Cuddling.", + "The chronic.", + "Cockfights.", + "Friendly fire.", + "Ronald Reagan.", + "A disappointing birthday party.", + "A sassy black woman.", + "Mathletes.", + "A tiny horse.", + "William Shatner.", + "Riding off into the sunset.", + "An M. Night Shyamalan plot twist.", + "Jew-fros.", + "Mutually-assured destruction.", + "Pedophiles.", + "Yeast.", + "Grave robbing.", + "Eating the last known bison.", + "Catapults.", + "Poor people.", + "Forgetting the Alamo.", + "The Hustle.", + "The Force.", + "Wiping her butt.", + "Intelligent design.", + "Loose lips.", + "AIDS.", + "Pictures of boobs.", + "The Ubermensch.", + "Sarah Palin.", + "American Gladiators.", + "Getting really high.", + "Scientology.", + "Penis envy.", + "Praying the gay away.", + "Frolicking.", + "Two midgets shitting into a bucket.", + "The KKK.", + "Genghis Khan.", + "Crystal meth.", + "Serfdom.", + "Stranger danger.", + "A Bop It.", + "Shaquille O'Neal's acting career.", + "Prancing.", + "Vigilante justice.", + "Overcompensation.", + "Pixelated bukkake.", + "A lifetime of sadness.", + "Racism.", + "Dwarf tossing.", + "Sunshine and rainbows.", + "A monkey smoking a cigar.", + "Flash flooding.", + "Lance Armstrong's missing testicle.", + "Dry heaving.", + "The terrorists.", + "Britney Spears at 55.", + "Attitude.", + "Breaking out into song and dance.", + "Leprosy.", + "Gloryholes.", + "Nipple blades.", + "The heart of a child.", + "Puppies!", + "Waking up half-naked in a Denny's parking lot.", + "Dental dams.", + "Toni Morrison's vagina.", + "The taint; the grundle; the fleshy fun-bridge.", + "Active listening.", + "Ethnic cleansing.", + "The Little Engine That Could.", + "The invisible hand.", + "Waiting 'til marriage.", + "Unfathomable stupidity.", + "Euphoria by Calvin Klein.", + "Re-gifting.", + "Autocannibalism.", + "Erectile dysfunction.", + "My collection of high-tech sex toys.", + "The Pope.", + "White people.", + "Tentacle porn.", + "Glenn Beck convulsively vomiting as a brood of crab spiders hatches in his brain and erupts from his tear ducts.", + "Too much hair gel.", + "Seppuku.", + "Same-sex ice dancing.", + "Cheating in the Special Olympics.", + "Charisma.", + "Keanu Reeves.", + "Sean Penn.", + "Nickelback.", + "A look-see.", + "Pooping back and forth. Forever.", + "Menstruation.", + "Kids with ass cancer.", + "A salty surprise.", + "The South.", + "The violation of our most basic human rights.", + "YOU MUST CONSTRUCT ADDITIONAL PYLONS.", + "Date rape.", + "Being fabulous.", + "Necrophilia.", + "Centaurs.", + "Bill Nye the Science Guy.", + "Black people.", + "Chivalry.", + "Lunchables.", + "Bitches.", + "The profoundly handicapped.", + "Heartwarming orphans.", + "MechaHitler.", + "Fiery poops.", + "Another goddamn vampire movie.", + "Tangled Slinkys.", + "The true meaning of Christmas.", + "Estrogen.", + "A zesty breakfast burrito.", + "That thing that electrocutes your abs.", + "Passing a kidney stone.", + "A bleached asshole.", + "Michael Jackson.", + "Cybernetic enhancements.", + "Guys who don't call.", + "Smallpox blankets.", + "Masturbation.", + "Classist undertones.", + "Queefing.", + "Concealing a boner.", + "Edible underpants.", + "Viagra.", + "Soup that is too hot.", + "Muhammad (Praise Be Unto Him).", + "Surprise sex!", + "Five-Dollar Footlongs.", + "Drinking alone.", + "Dick fingers.", + "Multiple stab wounds.", + "Soiling oneself.", + "Child abuse.", + "Anal beads.", + "Civilian casualties.", + "Pulling out.", + "Robert Downey, Jr.", + "Horse meat.", + "A really cool hat.", + "Kim Jong-il.", + "A stray pube.", + "Jewish fraternities.", + "The token minority.", + "Doin' it in the butt.", + "Feeding Rosie O'Donnell.", + "Teaching a robot to love.", + "A can of whoop-ass.", + "A windmill full of corpses.", + "Count Chocula.", + "Wearing underwear inside-out to avoid doing laundry.", + "A death ray.", + "The glass ceiling.", + "A cooler full of organs.", + "The American Dream.", + "Keg stands.", + "When you fart and a little bit comes out.", + "Take-backsies.", + "Dead babies.", + "Foreskin.", + "Saxophone solos.", + "Italians.", + "A fetus.", + "Firing a rifle into the air while balls deep in a squealing hog.", + "Dick Cheney.", + "Amputees.", + "Eugenics.", + "My relationship status.", + "Christopher Walken.", + "Bees?", + "Harry Potter erotica.", + "College.", + "Getting drunk on mouthwash.", + "Nazis.", + "8 oz. of sweet Mexican black-tar heroin.", + "Stephen Hawking talking dirty.", + "Dead parents.", + "Object permanence.", + "Opposable thumbs.", + "Racially-biased SAT questions.", + "Jibber-jabber.", + "Chainsaws for hands.", + "Nicolas Cage.", + "Child beauty pageants.", + "Explosions.", + "Sniffing glue.", + "Glenn Beck being harried by a swarm of buzzards.", + "Repression.", + "Roofies.", + "My vagina.", + "Assless chaps.", + "A murder most foul.", + "Giving 110 percent.", + "Her Royal Highness, Queen Elizabeth II.", + "The Trail of Tears.", + "Being marginalized.", + "Goblins.", + "Hope.", + "The Rev. Dr. Martin Luther King, Jr.", + "A micropenis.", + "My soul.", + "A hot mess.", + "Vikings.", + "Hot people.", + "Seduction.", + "An Oedipus complex.", + "Geese.", + "Global warming.", + "New Age music.", + "Hot Pockets.", + "Making a pouty face.", + "Vehicular manslaughter.", + "Women's suffrage.", + "A defective condom.", + "Judge Judy.", + "African children.", + "The Virginia Tech Massacre.", + "Barack Obama.", + "Asians who aren't good at math.", + "Elderly Japanese men.", + "Exchanging pleasantries.", + "Heteronormativity.", + "Parting the Red Sea.", + "Arnold Schwarzenegger.", + "Road head.", + "Spectacular abs.", + "Figgy pudding.", + "A mopey zoo lion.", + "A bag of magic beans.", + "Poor life choices.", + "My sex life.", + "Auschwitz.", + "A snapping turtle biting the tip of your penis.", + "A thermonuclear detonation.", + "The clitoris.", + "The Big Bang.", + "Land mines.", + "Friends who eat all the snacks.", + "Goats eating cans.", + "The Dance of the Sugar Plum Fairy.", + "Jerking off into a pool of children's tears.", + "Man meat.", + "Me time.", + "The Underground Railroad.", + "Poorly-timed Holocaust jokes.", + "A sea of troubles.", + "Lumberjack fantasies.", + "Morgan Freeman's voice.", + "Women in yogurt commercials.", + "Natural male enhancement.", + "Being a motherfucking sorcerer.", + "Genital piercings.", + "Passable transvestites.", + "Sexy pillow fights.", + "Balls.", + "Grandma.", + "Friction.", + "Party poopers.", + "Farting and walking away.", + "Being a dick to children.", + "Booby-trapping the house to foil burglars.", + "The Tempur-Pedic Swedish Sleep System.", + "Dying.", + "Hurricane Katrina.", + "The gays.", + "The folly of man.", + "Men.", + "The Amish.", + "Pterodactyl eggs.", + "Team-building exercises.", + "A brain tumor.", + "Cards Against Humanity.", + "Fear itself.", + "Lady Gaga.", + "The milk man.", + "A foul mouth.", + "A big black dick.", + "A beached whale.", + "A bloody pacifier.", + "A crappy little hand.", + "A low standard of living.", + "A nuanced critique.", + "Panty raids.", + "A passionate Latino lover.", + "A rival dojo.", + "A web of lies.", + "A woman scorned.", + "Clams.", + "Apologizing.", + "Appreciative snapping.", + "Neil Patrick Harris.", + "Beating your wives.", + "Being a dinosaur.", + "Shaft.", + "Bosnian chicken farmers.", + "Nubile slave boys.", + "Carnies.", + "Coughing into a vagina.", + "Suicidal thoughts.", + "Dancing with a broom.", + "Deflowering the princess.", + "Dorito breath.", + "Eating an albino.", + "Enormous Scandinavian women.", + "Fabricating statistics.", + "Finding a skeleton.", + "Gandalf.", + "Genetically engineered super-soldiers.", + "George Clooney's musk.", + "Getting abducted by Peter Pan.", + "Getting in her pants, politely.", + "Gladiatorial combat.", + "Good grammar.", + "Hipsters.", + "Historical revisionism.", + "Insatiable bloodlust.", + "Jafar.", + "Jean-Claude Van Damme.", + "Just the tip.", + "Mad hacky-sack skills.", + "Leveling up.", + "Literally eating shit.", + "Making the penises kiss.", + "Media coverage.", + "Medieval Times Dinner and Tournament.", + "Moral ambiguity.", + "My machete.", + "One thousand Slim Jims.", + "Ominous background music.", + "Overpowering your father.", + "Pistol-whipping a hostage.", + "Quiche.", + "Quivering jowls.", + "Revenge fucking.", + "Ripping into a man's chest and pulling out his still-beating heart.", + "Ryan Gosling riding in on a white horse.", + "Santa Claus.", + "Scrotum tickling.", + "Sexual humiliation.", + "Sexy Siamese twins.", + "Slow motion.", + "Space muffins.", + "Statistically validated stereotypes.", + "Sudden Poop Explosion Disease.", + "The boners of the elderly.", + "The economy.", + "The Fanta girls.", + "The Gulags.", + "The harsh light of day.", + "The hiccups.", + "The shambling corpse of Larry King.", + "The four arms of Vishnu.", + "Being a busy adult with many important things to do.", + "Tripping balls.", + "Words, words, words.", + "Zeus's sexual appetites.", + ] + def bcards(): return [ - "TSA guidelines now prohibit __________ on airplanes.", - "It's a pity that kids these days are all getting involved with __________.", - "In 1,000 years, when paper money is but a distant memory, __________ will be our currency.", - "Major League Baseball has banned __________ for giving players an unfair advantage.", - "What is Batman's guilty pleasure?", - "Next from J.K. Rowling: Harry Potter and the Chamber of __________.", - "I'm sorry, Professor, but I couldn't complete my homework because of __________.", - "What did I bring back from Mexico?", - "__________? There's an app for that.", - "__________. Betcha can't have just one!", - "What's my anti-drug?", - "While the United States raced the Soviet Union to the moon, the Mexican government funneled millions of pesos into research on __________.", - "In the new Disney Channel Original Movie, Hannah Montana struggles with __________ for the first time. ", - "What's my secret power?", - "What's the new fad diet?", - "What did Vin Diesel eat for dinner?", - "When Pharaoh remained unmoved, Moses called down a Plague of __________.", - "How am I maintaining my relationship status?", - "What's the crustiest?", - "In L.A. County Jail, word is you can trade 200 cigarettes for __________.", - "After the earthquake, Sean Penn brought __________ to the people of Haiti.", - "Instead of coal, Santa now gives the bad children __________.", - "Life for American Indians was forever changed when the White Man introduced them to __________.", - "What's Teach for America using to inspire inner city students to succeed?", - "Maybe she's born with it. Maybe it's __________.", - "In Michael Jackson's final moments, he thought about __________.", - "White people like __________.", - "Why do I hurt all over?", - "A romantic, candlelit dinner would be incomplete without __________.", - "What will I bring back in time to convince people that I am a powerful wizard?", - "BILLY MAYS HERE FOR __________.", - "The class field trip was completely ruined by __________.", - "What's a girl's best friend?", - "Dear Abby, I'm having some trouble with __________ and would like your advice.", - "When I am President of the United States, I will create the Department of __________.", - "What are my parents hiding from me?", - "What never fails to liven up the party?", - "What gets better with age?", - "__________: Good to the last drop.", - "I got 99 problems but __________ ain't one.", - "__________. It's a trap!", - "MTV's new reality show features eight washed-up celebrities living with __________.", - "What would grandma find disturbing, yet oddly charming?", - "What's the most emo?", - "During sex, I like to think about __________.", - "What ended my last relationship?", - "What's that sound?", - "__________. That's how I want to die.", - "Why am I sticky?", - "What's the next Happy Meal toy?", - "What's there a ton of in heaven?", - "I do not know with what weapons World War III will be fought, but World War IV will be fought with __________.", - "What will always get you laid?", - "__________: Kid-tested, mother-approved.", - "Why can't I sleep at night?", - "What's that smell?", - "What helps Obama unwind?", - "This is the way the world ends / This is the way the world ends / Not with a bang but with __________.", - "Coming to Broadway this season, __________: The Musical.", - "Anthropologists have recently discovered a primitive tribe that worships __________.", - "But before I kill you, Mr. Bond, I must show you __________.", - "Studies show that lab rats navigate mazes 50% faster after being exposed to __________.", - "Next on ESPN2: The World Series of __________.", - "When I am a billionaire, I shall erect a 50-foot statue to commemorate __________.", - "In an attempt to reach a wider audience, the Smithsonian Museum of Natural History has opened an interactive exhibit on __________.", - "War! What is it good for?", - "What gives me uncontrollable gas?", - "What do old people smell like?", - "What am I giving up for Lent?", - "Alternative medicine is now embracing the curative powers of __________.", - "What did the US airdrop to the children of Afghanistan?", - "What does Dick Cheney prefer?", - "During Picasso's often-overlooked Brown Period, he produced hundreds of paintings of __________.", - "What don't you want to find in your Chinese food?", - "I drink to forget __________.", - "__________. High five, bro.", - "He who controls __________ controls the world.", - "The CIA now interrogates enemy agents by repeatedly subjecting them to __________.", - "In Rome, there are whisperings that the Vatican has a secret room devoted to __________.", - "Science will never explain the origin of __________.", - "When all else fails, I can always masturbate to __________.", - "I learned the hard way that you can't cheer up a grieving friend with __________.", - "In its new tourism campaign, Detroit proudly proclaims that it has finally eliminated __________.", - "The socialist governments of Scandinavia have declared that access to __________ is a basic human right.", - "In his new self-produced album, Kanye West raps over the sounds of __________.", - "What's the gift that keeps on giving?", - "This season on Man vs. Wild, Bear Grylls must survive in the depths of the Amazon with only __________ and his wits. ", - "When I pooped, what came out of my butt?", - "In the distant future, historians will agree that __________ marked the beginning of America's decline.", - "What has been making life difficult at the nudist colony?", - "And I would have gotten away with it, too, if it hadn't been for __________.", - "What brought the orgy to a grinding halt?", -] + "TSA guidelines now prohibit __________ on airplanes.", + "It's a pity that kids these days are all getting involved with __________.", + "In 1,000 years, when paper money is but a distant memory, __________ will be our currency.", + "Major League Baseball has banned __________ for giving players an unfair advantage.", + "What is Batman's guilty pleasure?", + "Next from J.K. Rowling: Harry Potter and the Chamber of __________.", + "I'm sorry, Professor, but I couldn't complete my homework because of __________.", + "What did I bring back from Mexico?", + "__________? There's an app for that.", + "__________. Betcha can't have just one!", + "What's my anti-drug?", + "While the United States raced the Soviet Union to the moon, the Mexican government funneled millions of pesos into research on __________.", + "In the new Disney Channel Original Movie, Hannah Montana struggles with __________ for the first time. ", + "What's my secret power?", + "What's the new fad diet?", + "What did Vin Diesel eat for dinner?", + "When Pharaoh remained unmoved, Moses called down a Plague of __________.", + "How am I maintaining my relationship status?", + "What's the crustiest?", + "In L.A. County Jail, word is you can trade 200 cigarettes for __________.", + "After the earthquake, Sean Penn brought __________ to the people of Haiti.", + "Instead of coal, Santa now gives the bad children __________.", + "Life for American Indians was forever changed when the White Man introduced them to __________.", + "What's Teach for America using to inspire inner city students to succeed?", + "Maybe she's born with it. Maybe it's __________.", + "In Michael Jackson's final moments, he thought about __________.", + "White people like __________.", + "Why do I hurt all over?", + "A romantic, candlelit dinner would be incomplete without __________.", + "What will I bring back in time to convince people that I am a powerful wizard?", + "BILLY MAYS HERE FOR __________.", + "The class field trip was completely ruined by __________.", + "What's a girl's best friend?", + "Dear Abby, I'm having some trouble with __________ and would like your advice.", + "When I am President of the United States, I will create the Department of __________.", + "What are my parents hiding from me?", + "What never fails to liven up the party?", + "What gets better with age?", + "__________: Good to the last drop.", + "I got 99 problems but __________ ain't one.", + "__________. It's a trap!", + "MTV's new reality show features eight washed-up celebrities living with __________.", + "What would grandma find disturbing, yet oddly charming?", + "What's the most emo?", + "During sex, I like to think about __________.", + "What ended my last relationship?", + "What's that sound?", + "__________. That's how I want to die.", + "Why am I sticky?", + "What's the next Happy Meal toy?", + "What's there a ton of in heaven?", + "I do not know with what weapons World War III will be fought, but World War IV will be fought with __________.", + "What will always get you laid?", + "__________: Kid-tested, mother-approved.", + "Why can't I sleep at night?", + "What's that smell?", + "What helps Obama unwind?", + "This is the way the world ends / This is the way the world ends / Not with a bang but with __________.", + "Coming to Broadway this season, __________: The Musical.", + "Anthropologists have recently discovered a primitive tribe that worships __________.", + "But before I kill you, Mr. Bond, I must show you __________.", + "Studies show that lab rats navigate mazes 50% faster after being exposed to __________.", + "Next on ESPN2: The World Series of __________.", + "When I am a billionaire, I shall erect a 50-foot statue to commemorate __________.", + "In an attempt to reach a wider audience, the Smithsonian Museum of Natural History has opened an interactive exhibit on __________.", + "War! What is it good for?", + "What gives me uncontrollable gas?", + "What do old people smell like?", + "What am I giving up for Lent?", + "Alternative medicine is now embracing the curative powers of __________.", + "What did the US airdrop to the children of Afghanistan?", + "What does Dick Cheney prefer?", + "During Picasso's often-overlooked Brown Period, he produced hundreds of paintings of __________.", + "What don't you want to find in your Chinese food?", + "I drink to forget __________.", + "__________. High five, bro.", + "He who controls __________ controls the world.", + "The CIA now interrogates enemy agents by repeatedly subjecting them to __________.", + "In Rome, there are whisperings that the Vatican has a secret room devoted to __________.", + "Science will never explain the origin of __________.", + "When all else fails, I can always masturbate to __________.", + "I learned the hard way that you can't cheer up a grieving friend with __________.", + "In its new tourism campaign, Detroit proudly proclaims that it has finally eliminated __________.", + "The socialist governments of Scandinavia have declared that access to __________ is a basic human right.", + "In his new self-produced album, Kanye West raps over the sounds of __________.", + "What's the gift that keeps on giving?", + "This season on Man vs. Wild, Bear Grylls must survive in the depths of the Amazon with only __________ and his wits. ", + "When I pooped, what came out of my butt?", + "In the distant future, historians will agree that __________ marked the beginning of America's decline.", + "What has been making life difficult at the nudist colony?", + "And I would have gotten away with it, too, if it hadn't been for __________.", + "What brought the orgy to a grinding halt?", + ] + def bcards2(): return [ - "That's right, I killed __________. How, you ask? __________.", - "And the Academy Award for __________ goes to __________.", - "For my next trick, I will pull __________ out of __________.", - "In his new summer comedy, Rob Schneider is __________ trapped in the body of __________.", - "When I was tripping on acid, __________ turned into __________.", - "__________ is a slippery slope that leads to __________.", - "In a world ravaged by __________, our only solace is __________.", - "In M. Night Shyamalan's new movie, Bruce Willis discovers that __________ had really been __________ all along.", - "I never truly understood __________ until I encountered __________.", - "Rumor has it that Vladimir Putin's favorite dish is __________ stuffed with __________.", - "Lifetime presents __________, the story of __________.", - "What's the next superhero/sidekick duo?", -] \ No newline at end of file + "That's right, I killed __________. How, you ask? __________.", + "And the Academy Award for __________ goes to __________.", + "For my next trick, I will pull __________ out of __________.", + "In his new summer comedy, Rob Schneider is __________ trapped in the body of __________.", + "When I was tripping on acid, __________ turned into __________.", + "__________ is a slippery slope that leads to __________.", + "In a world ravaged by __________, our only solace is __________.", + "In M. Night Shyamalan's new movie, Bruce Willis discovers that __________ had really been __________ all along.", + "I never truly understood __________ until I encountered __________.", + "Rumor has it that Vladimir Putin's favorite dish is __________ stuffed with __________.", + "Lifetime presents __________, the story of __________.", + "What's the next superhero/sidekick duo?", + ] diff --git a/functions.py b/functions.py index c67e4fe..f202d02 100644 --- a/functions.py +++ b/functions.py @@ -4,31 +4,35 @@ import cards from random import shuffle + def actioner(g, line, username, channel, gamechannel): lower = line.lower() messages = [] - if g.inprogress: + if g.inprogress: if lower == "start": - messages.append({"message": "Could not start because game is already in progress", "channel": gamechannel}) + messages.append({ + "message": "Could not start because game is already in progress", + "channel": gamechannel}) else: if lower == "start": if len(g.players) >= g.minplayers: - starttime = datetime.now() timetostart = 2 - g.starttime = datetime.now() + timedelta(seconds = timetostart) - messages.append({"message": "Starting game in %s seconds" % timetostart, "channel": gamechannel}) + g.starttime = datetime.now() + timedelta(seconds=timetostart) + messages.append({ + "message": "Starting game in %s seconds" % timetostart, + "channel": gamechannel}) else: - messages.append({"message": "Could not start because there aren't enough players", "channel": gamechannel}) - + messages.append({ + "message": "Could not start because there aren't enough players", + "channel": gamechannel}) if lower == "stop": stopmessage = g.stop() messages.append({"message": stopmessage, "channel": gamechannel}) - elif lower == "gamestatus": messages.append({"message": g.inprogress, "channel": gamechannel}) @@ -38,22 +42,31 @@ def actioner(g, line, username, channel, gamechannel): for player in g.players: playernames.append(player.username) playerstring = " ".join(playernames) - messages.append({"message": "Players: %s" % playerstring, "channel": gamechannel}) + messages.append({ + "message": "Players: %s" % playerstring, + "channel": gamechannel}) else: - messages.append({"message": "No players have joined the game", "channel": gamechannel}) + messages.append({ + "message": "No players have joined the game", + "channel": gamechannel}) elif lower == "join": - newplayer = g.getPlayerByName(username) + # newplayer = g.getPlayerByName(username) + g.getPlayerByName(username) # dunno if this is useful block = 0 for player in g.players: if username == player.username: block = 1 if block == 1: - messages.append({"message": "Error, cannot join game, you're already in it", "channel": gamechannel}) + messages.append({ + "message": "Error, cannot join game, you're already in it", + "channel": gamechannel}) else: newPlayer = Player(username) g.players.append(newPlayer) - messages.append({"message": "%s joined the game" %username, "channel": gamechannel}) + messages.append({ + "message": "%s joined the game" % username, + "channel": gamechannel}) g.dealCards() if g.inprogress: messages += [{"message": g.blackcard, "channel": username}] @@ -66,98 +79,126 @@ def actioner(g, line, username, channel, gamechannel): elif lower == "czar": if g.inprogress: - messages.append({"message": "The Card Czar is %s" %g.czar.username, "channel": gamechannel}) + messages.append({ + "message": "The Card Czar is %s" % g.czar.username, + "channel": gamechannel}) else: - messages.append({"message": "There is no Card Czar yet", "channel": gamechannel}) + messages.append({ + "message": "There is no Card Czar yet", + "channel": gamechannel}) + elif lower[:5] == "kill ": - messages.append({"message": "DIE %s DIE!" % line[5:].upper(), "channel": gamechannel}) + messages.append({ + "message": "DIE %s DIE!" % line[5:].upper(), + "channel": gamechannel}) elif lower == "cards": player = g.getPlayerByName(username) messages += player.printCards() elif lower == "countcards": - messages.append({"message": "There are %s cards remaining" % len(g.wcards), "channel": gamechannel}) + messages.append({ + "message": "There are %s cards remaining" % len(g.wcards), + "channel": gamechannel}) elif lower == "$playedcards": messages.append({"message": g.playedCards, "channel": channel}) elif lower == "scores": - messages.append({"message": "The scores are as follows:", "channel": channel}) + messages.append({ + "message": "The scores are as follows:", "channel": channel}) for player in g.players: - messages.append({"message": "%s: %s" %(player.username, player.score), "channel": channel}) + messages.append({ + "message": "%s: %s" % (player.username, player.score), + "channel": channel}) elif lower == "test": - messages.append({"message": "testing functions", "channel": gamechannel}) + messages.append({ + "message": "testing functions", "channel": gamechannel}) elif lower == "wcards": print g.wcards elif lower == "bcards": print g.bcards elif lower == "bcards2": print g.bcards2 - - return messages + def gameLogic(g, line, username, channel, gamechannel): - if line: - lower = line.lower() + # if line: + # lower = line.lower() messages = [] if len(g.players) < g.minplayers: if g.starttime or g.inprogress: g.stop() - if g.starttime: currtime = datetime.now() if currtime > g.starttime: g.starttime = None g.inprogress = True shuffle(g.players) - messages.append({"message": "Starting game now!", "channel": gamechannel}) + messages.append({ + "message": "Starting game now!", "channel": gamechannel}) elif g.newround > g.round: if not g.czar: g.czar = g.players[0] g.round = g.newround if len(g.allbcards) > 0: - messages.append({"message": "Starting round %s. The Card Czar is %s" %(g.newround, g.czar.username), "channel": gamechannel}) + messages.append({ + "message": "Starting round %s. The Card Czar is %s" % (g.newround, g.czar.username), + "channel": gamechannel}) g.dealCards() blackcard = g.allbcards.pop(0) g.blackcard = blackcard["card"] g.blacktype = blackcard["type"] for player in g.players: if not g.czar == player: - messages += [{"message": g.blackcard, "channel": player.username}] + messages += [{ + "message": g.blackcard, "channel": player.username}] if g.blacktype == 2: - messages.append({"message": "Please select your cards by typing in the format x y", "channel": player.username}) + messages.append({ + "message": "Please select your cards by typing in the format x y", + "channel": player.username}) messages += player.printCards() #g.setTopic() messages.append({"message": g.blackcard, "channel": gamechannel}) g.waitPlayers = 1 else: - messages.append({"message": "The game is over! The final scores are as follows:", "channel": channel}) + messages.append({ + "message": "The game is over! The final scores are as follows:", + "channel": channel}) for player in g.players: - messages.append({"message": "%s: %s" %(player.username, player.score), "channel": channel}) + messages.append({ + "message": "%s: %s" % (player.username, player.score), + "channel": channel}) g.stop() elif g.waitPlayers > 0: #print g.playedCards if g.waitPlayers == 1: - messages.append({"message": "The Players must each pick a card, by messaging the number to humanitybot", "channel": gamechannel}) + messages.append({ + "message": "The Players must each pick a card, by messaging the number to humanitybot", + "channel": gamechannel}) if g.blacktype == 2: - messages.append({"message": "Please select your cards by typing in the format x y", "channel": gamechannel}) + messages.append({ + "message": "Please select your cards by typing in the format x y", + "channel": gamechannel}) g.waitPlayers = 2 if len(g.playedCards) == len(g.players) - 1: g.waitPlayers = 0 g.waitCzar = 1 elif line: if g.blacktype == 1: - if re.search("^([0-9]|10)$", line) and not username == g.czar.username: + if re.search("^([0-9]|10)$", line) \ + and not username == g.czar.username: player = g.getPlayerByName(username) if player in g.playedPlayers: - messages += [{"message": "You cannot play more than one card", "channel": username}] + messages += [{ + "message": "You cannot play more than one card", + "channel": username}] else: g.playedPlayers.append(player) id = int(line) @@ -166,13 +207,19 @@ def gameLogic(g, line, username, channel, gamechannel): id -= 1 if id < 10 and id >= 0: card = player.hand.pop(id) - messages += [{"message": "Thank you for playing %s" %(card), "channel": player.username}] - g.playedCards.append({"card": card, "owner": player}) + messages += [{ + "message": "Thank you for playing %s" % (card), + "channel": player.username}] + g.playedCards.append({ + "card": card, "owner": player}) elif g.blacktype == 2: - if re.search("^([0-9]|10) ([0-9]|10)+$", line) and not username == g.czar.username: + if re.search("^([0-9]|10) ([0-9]|10)+$", line) \ + and not username == g.czar.username: player = g.getPlayerByName(username) if player in g.playedPlayers: - messages += [{"message": "You cannot play more than one card", "channel": username}] + messages += [{ + "message": "You cannot play more than one card", + "channel": username}] else: g.playedPlayers.append(player) ids = line.split() @@ -184,24 +231,32 @@ def gameLogic(g, line, username, channel, gamechannel): if id2 == 0: id2 = 10 id2 -= 1 - if id1 < 10 and id1 >= 0 and id2 < 10 and id2 >=0: + if id1 < 10 and id1 >= 0 and id2 < 10 and id2 >= 0: card1 = player.hand[id1] card2 = player.hand[id2] - messages += [{"message": "Thank you for playing %s / %s" %(card1, card2), "channel": player.username}] - g.playedCards.append({"card": "%s / %s" %(card1, card2), "owner": player}) + messages += [{ + "message": "Thank you for playing %s / %s" % (card1, card2), + "channel": player.username}] + g.playedCards.append({ + "card": "%s / %s" % (card1, card2), + "owner": player}) player.hand.remove(card1) player.hand.remove(card2) elif g.waitCzar > 0: if g.waitCzar == 1: shuffle(g.playedCards) - messages.append({"message": "The Czar, %s, must pick a card" % g.czar.username, "channel": gamechannel}) + messages.append({ + "message": "The Czar, %s, must pick a card" % g.czar.username, + "channel": gamechannel}) messages.append({"message": g.blackcard, "channel": gamechannel}) i = 1 spacer = " " for card in g.playedCards: if i > 9: spacer = " " - messages.append({"message": "%s)%s%s" %(i, spacer, card["card"]),"channel": gamechannel}) + messages.append({ + "message": "%s)%s%s" % (i, spacer, card["card"]), + "channel": gamechannel}) i += 1 g.waitCzar = 2 elif line and g.waitCzar == 2: @@ -210,7 +265,9 @@ def gameLogic(g, line, username, channel, gamechannel): if cardID < len(g.playedCards) and cardID >= 0: cardText = g.playedCards[cardID]["card"] cardOwner = g.playedCards[cardID]["owner"] - messages.append({"message": "The Czar picked card %s: %s %s has won the round!" %(cardID + 1, cardText, cardOwner.username), "channel": gamechannel}) + messages.append({ + "message": "The Czar picked card %s: %s %s has won the round!" % (cardID + 1, cardText, cardOwner.username), + "channel": gamechannel}) cardOwner.score += 1 g.waitCzar = 0 g.newround += 1 @@ -221,16 +278,17 @@ def gameLogic(g, line, username, channel, gamechannel): if player == g.czar: czarid = i i += 1 - czarid +=1 - if czarid > len(g.players) -1: + czarid += 1 + if czarid > len(g.players) - 1: czarid = 0 g.czar = g.players[czarid] g.playedPlayers = [] return messages + class Player(): - def __init__ (self, username): + def __init__(self, username): self.username = username self.hand = [] self.score = 0 @@ -238,15 +296,14 @@ def __init__ (self, username): def printCards(self): messages = [{"message": "Your cards are:", "channel": self.username}] i = 1 - cards = "" + _cards = "" for card in self.hand: - cards += "%s) %s " % (i,card) + _cards += "%s) %s " % (i, card) i += 1 - messages.append({"message": cards, "channel": self.username}) + messages.append({"message": _cards, "channel": self.username}) return messages - class Game(): def __init__(self, s): self.inprogress = False @@ -288,11 +345,11 @@ def stop(self): # self.waitPlayers = 0 # self.playedCards = [] # self.newround = 1 - # + # # shuffle(self.wcards) #self.threadDetails.s.send("TOPIC %s :Welcome to Chat Against Humanity. Visit http://www.chatagainsthumanity.com for a list of commands.\n" %(self.threadDetails.channel)) - return "Stopping game" + def dealCards(self): for player in self.players: toDeal = 10 - len(player.hand) @@ -320,9 +377,9 @@ def part(self, playername): if player.username == playername: cont = True if cont: - message = "%s left the game." %playername - if len(self.players) -1 < self.minplayers and self.inprogress: - stop = self.stop() + message = "%s left the game." % playername + if len(self.players) - 1 < self.minplayers and self.inprogress: + self.stop() message += " Not enough players to continue, stopping game." else: if self.inprogress: @@ -343,8 +400,8 @@ def part(self, playername): if newplayer == self.czar: czarid = i i += 1 - czarid +=1 - if czarid > len(self.players) -1: + czarid += 1 + if czarid > len(self.players) - 1: czarid = 0 self.czar = self.players[czarid] self.players.remove(player) @@ -356,4 +413,3 @@ def part(self, playername): else: message = None return message - diff --git a/sprbt.py b/sprbt.py index bf9a3c6..9b62a04 100755 --- a/sprbt.py +++ b/sprbt.py @@ -8,8 +8,9 @@ import select import functions -class IRCConnector( threading.Thread): - def __init__ (self, host, port): + +class IRCConnector(threading.Thread): + def __init__(self, host, port): self.host = host self.port = port self.channel = "#cah" @@ -20,17 +21,18 @@ def __init__ (self, host, port): self.allmessages = [] self.lastmessage = datetime.now() self.pulsetime = 500 - threading.Thread.__init__ ( self ) + threading.Thread.__init__(self) def output(self, message): - print("Server: %s\nMessage:%s\n" %(self.host, message)) + print("Server: %s\nMessage:%s\n" % (self.host, message)) def say(self, message): #print "sending %s" % message - messagetosend = "PRIVMSG %s :%s\n" %(message["channel"], message["message"]) + messagetosend = "PRIVMSG %s :%s\n" % ( + message["channel"], message["message"]) self.s.send(messagetosend) - def run (self): + def run(self): try: self.s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) except: @@ -43,15 +45,15 @@ def run (self): #self.s.connect((remote_ip, self.port)) self.s.connect((self.host, self.port)) self.s.setblocking(0) - message1 = "NICK %s\r\n" %self.botname - message2 = 'USER %s %s %s :%s\r\n' %(self.identity, self.hostname, self.host, self.realname) + message1 = "NICK %s\r\n" % self.botname + message2 = 'USER %s %s %s :%s\r\n' % ( + self.identity, self.hostname, self.host, self.realname) self.s.send(message1) self.s.send(message2) g = functions.Game(self) - - while 1: + while True: line = None message = None @@ -66,13 +68,13 @@ def run (self): line.strip() splitline = line.split(" :") - if "PING" in splitline[0]: - pong = "PONG %s" %splitline[1] + if "PING" in splitline[0]: + pong = "PONG %s" % splitline[1] self.output(pong) self.s.send(pong) if re.search(":End of /MOTD command.", line): - joinchannel = "JOIN %s\n" %self.channel + joinchannel = "JOIN %s\n" % self.channel self.output(joinchannel) self.s.send("PRIVMSG nickserv :identify hum4n1ty\n") self.s.send(joinchannel) @@ -88,14 +90,17 @@ def run (self): if player.username == oldnick: player.username = newnick - if re.search("^:.* QUIT .*$", line) or re.search("^:.* PART .*$", line): + if re.search("^:.* QUIT .*$", line) \ + or re.search("^:.* PART .*$", line): split1 = line.split() split2 = split1[0].split("!") username = split2[0][1:] print username message = g.part(username) if message: - self.allmessages.append({"message": message, "channel": self.channel}) + self.allmessages.append({ + "message": message, + "channel": self.channel}) if re.search("PRIVMSG", line): details = line.split() @@ -112,26 +117,35 @@ def run (self): if lower == "$kill" and username == "sprmtt": self.s.send("QUIT :Bot quit\n") elif lower == "$test": - self.allmessages.append({"message": "test message", "channel": channel}) + self.allmessages.append({ + "message": "test message", + "channel": channel}) elif lower == "$reload": try: reload(functions) - self.allmessages.append({"message": "Reloaded functions", "channel": channel}) + self.allmessages.append({ + "message": "Reloaded functions", + "channel": channel}) except: - self.allmessages.append({"message": "Unable to reload due to errors", "channel": channel}) + self.allmessages.append({ + "message": "Unable to reload due to errors", + "channel": channel}) else: - self.allmessages += functions.actioner(g, message, username, channel, self.channel) + self.allmessages += functions.actioner( + g, message, username, channel, self.channel) if re.search(":Closing Link:", line): sys.exit() if g.inprogress or g.starttime: - self.allmessages += functions.gameLogic(g, message, username, channel, self.channel) + self.allmessages += functions.gameLogic( + g, message, username, channel, self.channel) line = None message = None timestamp = datetime.now() if len(self.allmessages) > 0: - newtime = self.lastmessage + timedelta(milliseconds = self.pulsetime) + newtime = self.lastmessage \ + + timedelta(milliseconds=self.pulsetime) if timestamp > newtime: #print self.allmessages currmess = self.allmessages.pop(0) @@ -141,10 +155,10 @@ def run (self): irc_connections = [{ - "host": "irc.darkmyst.org", - "port": 6667, - "channels": ["#cah"] - }] + "host": "irc.darkmyst.org", + "port": 6667, + "channels": ["#cah"] +}] for irc in irc_connections: IRCThread = IRCConnector(irc['host'], irc['port'])