Introduction
Hello there, fellow TeX.sx users! I'm organizing a lottery. The idea is very similar to Who Wants to Win a LaTeX Book?, but both the lottery algorithm and the prize are different. Let me explain some things first.
Who are you?
I'm some random dude on the Internet who happens to hang out a lot in this very community. :)
What is the prize?
The prize will be a lovely duck.
Wait a minute, did you say duck?
Yes! :)
But not a real duck, it will be a hand puppet duck:
Lovely, isn't it?
Why a duck? Why not a lion?
Good question. :)
I always like to provide examples with ducks when I write answers. To my surprise, the theme got a very positive feedback from the community and it spread to everybody. Of course, a lion would be better, but hey, it's free! And it's a duck! :)
Why a hand puppet?
I have absolutely no idea. But since I got this duck, I thought it would be a good idea to start a contest! :)
Rules
- To win the duck you must guess a number in the range 1-200. The first person who guesses the right number gets the duck.
- Contestants may submit 2 valid guesses.
- Please post your guess as an answer to this meta question, not as a comment.
- Contestants must have been a member of TeX.sx before 21 December, 2013.
The lottery
I'll use the following code to pick the winner:
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{expl3}
\usepackage{xparse}
\usepackage{pgf}
\pgfmathsetseed{\number\pdfrandomseed}
\ExplSyntaxOn
\prop_new:N \g_duck_contest_prop
\int_new:N \g_duck_contest_upper_limit_int
\bool_new:N \l_duck_contest_winner_bool
\bool_set_false:N \l_duck_contest_winner_bool
\tl_new:N \l_duck_contest_winner_tl
\int_new:N \l_duck_contest_winning_number_int
\NewDocumentCommand { \person } { m m }
{
\clist_map_inline:nn { #1 }
{
\prop_if_in:NnTF \g_duck_contest_prop { ##1 }
{
Hey! ~ #2 ~ wants ~ to ~ be ~ naughty! ~
The ~ number ~ ##1 ~ was ~ already ~ chosen! \par
}
{
\prop_gput:Nnn \g_duck_contest_prop { ##1 } { #2 }
\int_gset:Nn \g_duck_contest_upper_limit_int
{
\int_max:nn { \g_duck_contest_upper_limit_int } { ##1 }
}
}
}
}
\NewDocumentCommand{ \winner } { }
{
\bool_do_until:Nn \l_duck_contest_winner_bool
{
\pgfmathrandom{1, \g_duck_contest_upper_limit_int}
\prop_get:NoN \g_duck_contest_prop { \pgfmathresult } \l_duck_contest_winner_tl
\quark_if_no_value:NF \l_duck_contest_winner_tl
{
\bool_set_true:N \l_duck_contest_winner_bool
}
}
\int_set_eq:NN \l_duck_contest_winning_number_int \pgfmathresult
\l_duck_contest_winner_tl
}
\cs_generate_variant:Nn \prop_get:NnN { No }
\NewDocumentCommand{ \winningnumber } { }
{
\int_to_arabic:n \l_duck_contest_winning_number_int
}
\ExplSyntaxOff
\begin{document}
% add yourself here
% ==============================
% For example, in the following line
% I picked 1 and 27, but I'm not
% participating in the contest :)
% \person{1,27}{Paulo Cereda}
\person{137,143}{Marco Daniel}
\person{65,105}{Ethan Bolker}
\person{68,130}{giordano}
\person{123,77}{Werner}
\person{124,100}{Stiff Jokes}
\person{15,97}{David Carlisle}
\person{22,44}{egreg}
\person{42,37}{tohecz}
\person{108,69}{Count Zero}
\person{47,167}{ppr}
\person{26,2}{marczellm}
\person{3,30}{Papiro}
\person{131,144}{percusse}
\person{33,66}{Harish Kumar}
\person{1,200}{Przemysław Scherwentke}
\person{4,5}{Frank Mittelbach}
\person{13,93}{Adam}
\person{23,177}{cgnieder}
\person{11,121}{texenthusiast}
\person{50,52}{Peter LeFanu Lumsdaine}
\person{14,29}{ricmarques}
\person{117,183}{Newb}
\person{82,88}{Francesco Endrici}
\person{122,171}{Claudio Fiandrino}
\person{17,21}{Dror}
\person{153,154}{topskip}
\person{74,147}{Sigur}
\person{193,38}{ComFreek}
\person{113,31}{Wayne Werner}
\person{6,7}{Andrew Stacey}
\person{12,171}{azetina}
\person{8,63}{Ignasi}
\person{28,99}{Andrea L.}
\person{25,116}{Benedikt Bauer}
\person{126,129}{Alan Munn}
\person{99,199}{lvaneesbeeck}
\person{197,53}{Pouya}
\person{20,125}{afrendeiro}
\person{45,152}{kan}
\person{114,115}{Philip}
\person{24,133}{doncherry}
\person{27,35}{Yori}
\person{79,186}{knut}
\person{12,173}{fifaltra}
\person{28,196}{Michael Hoppe}
\person{94,81}{XZS}
\person{10,172}{OSjerick}
\person{56,163}{laxxy}
% there was an entry to the code, but not as
% a proper answer, I'm sorry
% \person{8,9}{Joe Corneli}
% ==============================
% the announcement
The winner is \winner, with \winningnumber! Congratulations!
\end{document}
I'll run this code with all the contestants, post a video of it and announce the winner.
The date
Hopefully, I'll get the code running on January 1st, 2014, and announce the winner. :)
Good luck! :)
And by the way, welcome to TeX.sx, the friendliest and most awesome community in the whole StackExchange network! They give us hats, right? We give ducks!
----------------------------------------------------------------------------------
|◖■◗|◖■◗|◖■◗|◖■◗|◖■◗|◖■◗|◖■◗|◖■◗|009|◖■◗|◖■◗|◖■◗|◖■◗|◖■◗|◖■◗|016|◖■◗|018|019|◖■◗|
----------------------------------------------------------------------------------
|◖■◗|◖■◗|◖■◗|◖■◗|◖■◗|◖■◗|◖■◗|◖■◗|◖■◗|◖■◗|◖■◗|032|◖■◗|034|◖■◗|036|◖■◗|◖■◗|039|040|
----------------------------------------------------------------------------------
|041|◖■◗|043|◖■◗|◖■◗|046|◖■◗|048|049|◖■◗|051|◖■◗|◖■◗|054|055|◖■◗|057|058|059|060|
----------------------------------------------------------------------------------
|061|062|◖■◗|064|◖■◗|◖■◗|067|◖■◗|◖■◗|070|071|072|073|◖■◗|075|076|◖■◗|078|◖■◗|080|
----------------------------------------------------------------------------------
|◖■◗|◖■◗|083|084|085|086|087|◖■◗|089|090|091|092|◖■◗|◖■◗|095|096|◖■◗|098|◖■◗|◖■◗|
----------------------------------------------------------------------------------
|101|102|103|104|◖■◗|106|107|◖■◗|109|110|111|112|◖■◗|◖■◗|◖■◗|◖■◗|◖■◗|118|119|120|
----------------------------------------------------------------------------------
|◖■◗|◖■◗|◖■◗|◖■◗|◖■◗|◖■◗|127|128|◖■◗|◖■◗|◖■◗|132|◖■◗|134|135|136|◖■◗|138|139|140|
----------------------------------------------------------------------------------
|141|142|◖■◗|◖■◗|145|146|◖■◗|148|149|150|151|◖■◗|◖■◗|◖■◗|155|156|157|158|159|160|
----------------------------------------------------------------------------------
|161|162|◖■◗|164|165|166|◖■◗|168|169|170|◖■◗|◖■◗|◖■◗|174|175|176|◖■◗|178|179|180|
----------------------------------------------------------------------------------
|181|182|◖■◗|184|185|◖■◗|187|188|189|190|191|192|◖■◗|194|195|◖■◗|◖■◗|198|◖■◗|◖■◗|
----------------------------------------------------------------------------------
◖■◗
Update
Congrats to Dror for picking 17, the winning number! And thanks to all that joined the contest! Happy New Year! Here's the video with me running the code. :)
:)
:P
\begin{equation}\pi\end{equation}
arara
to compile the code. :-)