< Walks-the-Uncharted | WtU Monthly Raffle

A raffle is a means of raising money by selling numbered tickets, one or some of which are subsequently drawn at random, the holder or holders of such tickets winning a prize.


How do I enter?

Just remember! More tickets means more chances to win!

Prizes


First Prize
Second Prize
Third Prize
Fourth, fifth, sixth, and seventh Prize (aka Mini-Prizes)

Prize list is not finalized.

Next raffle drawing


2021-08-01

Other Information


How we pick the winners


We keep track of the raffle entries in a Google Docs spreadsheet, and when we draw the raffle, the first two columns are copied and pasted into the stdin of this script. We run it as many times as it takes to come up with seven unique winners. Please note that we draw the lowest prize first and work our way up, and no one can win more than once per raffle.

#!/bin/bash

workingfile="$(mktemp)"
shuffledfile="$(mktemp)"

while read line
do
  entry=1
  count=$(echo $line|awk '{print $2}')
  ticket="$(echo $line|awk '{print $1}')"

  echo "Entry: $ticket - $count"

  while [[ $entry -le $count ]]
  do
    echo "$ticket - $entry" >> $workingfile
    let ++entry
  done
done

totalentries="$(wc -l $workingfile|awk '{print $1}')"
echo -e "\033[36m$totalentries total entries\n\033[0m"

shuf $workingfile | sed '/^$/d' > $shuffledfile
rm $workingfile

#for winner in 1 2 3 4 5 6 7
#do
winningticket=$(awk "FNR==$(shuf -i 1-$totalentries -n1) {print \$0}" $shuffledfile)
echo -e "\033[32mWinner $winner is $winningticket\n\033[0m"
#done
rm $shuffledfile

written by @tralce on 2021-08-01