## Civ 5 giveaway

### Civ 5 giveaway

This give away was "suppose" to be done on March 1 2014, but since the forums went down before then. I didnt want to do the drawing without people seeing it.

The game is Civilization 5 base game, no DLC.
The trailer
http://store.steampowered.com/app/8930/

The rules were: Put in a number from 1-1000 and i will do a drawing of a random number. The person nearest to the that random number wins the game.

The current people signed up were:

stranac 343
mckryall 496
xndrk 822
i will just set a new drawing date.So lets do March 15 2013 as the new drawing date.

The drawing will be using this code:
Code: Select all
`import randomdatabase = {    'stranac':343,    'mckryall':496,    'xndrk':822}rand_num = random.randint(1,1000)nearest_num = min(list(database.values()), key=lambda x:abs(x-rand_num))print('Random number is: {}'.format(rand_num))for k,v in database.items():    if v == nearest_num:        print('Winner is: {} with the number {}'.format(k,v))        break`

So if your interested, post your desired number here, 2 more days.
OS Ubuntu 14.04, Arch Linux, Gentoo, Windows 7/8
https://github.com/metulburr
steam

metulburr

Posts: 1845
Joined: Thu Feb 07, 2013 4:47 pm
Location: Elmira, NY

### Re: Civ 5 giveaway

If you're going to use long ugly lines, might I suggest this?
Code: Select all
`winner = min((abs(choice-target), person) for person, choice in database.iteritems())[1]`

Also, I can tell you meant for this to be transparent and fair, but as it stands, stranac is most likely to win at about 42% chance and mckryall most likely to lose with a mere 24% chance. People who jump in later can take advantage of this information. Might I suggest simply using random.choice() on a list of names?
Join the #python-forum IRC channel on irc.freenode.net for off-topic chat!

Please prefer not to PM members. The point of the forum is so that anyone can benefit. We don't want to help you over PMs/emails/Skype chats that others can't benefit from

micseydel

Posts: 2038
Joined: Tue Feb 12, 2013 2:18 am
Location: Mountain View, CA

### Re: Civ 5 giveaway

micseydel wrote:Also, I can tell you meant for this to be transparent and fair, but as it stands, stranac is most likely to win at about 42% chance and mckryall most likely to lose with a mere 24% chance.

I think you made a mistake there.
My chance of winning actually gets doubled because I used a scientific method to choose the number, so it's would be about 84%.
But I get extra 10% for awesomeness, and 5% from magical power of unicorns, so my victory is almost guaranteed.
micseydel wrote:Might I suggest simply using random.choice() on a list of names?

But that takes away from the fun of it, and it would waste my efforts for scientifically choosing the best number.
Also, I would only have about 60% chance to win if he went with your suggestion.
Friendship is magic!

R.I.P. Tracy M. You will be missed.

stranac

Posts: 1486
Joined: Thu Feb 07, 2013 3:42 pm

### Re: Civ 5 giveaway

I probably should of kept the code used quit before numbers were chosen. I was expecting enough people for each to claim about a 100 numbers, but not enough people joined.

Actually I dont think the number guess is the fairest method, because the next two users can get the next number before and after you leaving you with one number, while they are claiming the numbers you expected to get. I just figured i would try something different than put your name in for random.choice()
OS Ubuntu 14.04, Arch Linux, Gentoo, Windows 7/8
https://github.com/metulburr
steam

metulburr

Posts: 1845
Joined: Thu Feb 07, 2013 4:47 pm
Location: Elmira, NY

### Re: Civ 5 giveaway

So is the bet still on?
If so I'm going for 231
Last edited by hansn on Fri Mar 14, 2014 7:44 am, edited 1 time in total.
hansn

Posts: 87
Joined: Thu Feb 21, 2013 8:46 pm

### Re: Civ 5 giveaway

yeah raffle still is on.
OS Ubuntu 14.04, Arch Linux, Gentoo, Windows 7/8
https://github.com/metulburr
steam

metulburr

Posts: 1845
Joined: Thu Feb 07, 2013 4:47 pm
Location: Elmira, NY

### Re: Civ 5 giveaway

The winner is:
Code: Select all
`Random number is: 70Winner is: hansn with the number 231`

EDIT:
raffle video

Congrats hansn
OS Ubuntu 14.04, Arch Linux, Gentoo, Windows 7/8
https://github.com/metulburr
steam

metulburr

Posts: 1845
Joined: Thu Feb 07, 2013 4:47 pm
Location: Elmira, NY

### Re: Civ 5 giveaway

hansn

Posts: 87
Joined: Thu Feb 21, 2013 8:46 pm