Skip to content

Wrote a silly program to select a random winner from my team

Notifications You must be signed in to change notification settings

jamietsao/random-winner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

random-winner

After receiving a $100 gift card to DoorDash for taking a sales call with a software vendor, I wanted to give it to someone random on the team. As a manager that rarely gets to write code these days, I decided to write a quick program to select the winner 🤓.

Table of Contents


Latest Version - 8/20/21

After reading this wonderful post about ANSI escape codes, this silly program I wrote last year was the perfect opportunity to dabble with them. So instead of immediately displaying the final results with an anti-climatic drumroll (see original version below), I used ANSI escape codes to simulate a dramatic race to the finish line.

Here was the original version from 8/4/20:

Here's the latest version using ANSI escape codes (and of course emojis):

Instructions for use

  1. Download script:
  2. Run script:

random-winner -names=Steph,Klay,Draymond,Iggy,Bogut


Original Version (run on 8/4/20)

Drumroll, please ... 🥁🥁🥁🥁

This was the result:

➜  random go run main.go

     Benny => 1250893
   Brandon => 1249641
      Andy => 1250759
      Eric => 1248545
   Leilani => 1250984
      Jeff => 1248989
      Bigo => 1251376
    Carmen => 1248813

The winner is .......
🥁
🥁
🥁
🥁
🥁
🥁

BIGO!!

Congrats, Bigo!

About

Wrote a silly program to select a random winner from my team

Resources

Stars

Watchers

Forks

Packages

No packages published