Skip to content

Latest commit

 

History

History
57 lines (43 loc) · 1.78 KB

README.md

File metadata and controls

57 lines (43 loc) · 1.78 KB

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!