La sfida
Il tuo obiettivo è quello di scrivere il programma più breve possibile che prenderà un elenco di eventi (come voto positivo, voto negativo, ecc.) E restituirà la reputazione dell'utente e i privilegi che ha guadagnato.
Che tipo di eventi?
Ecco un grafico degli eventi, elencati in ordine di reputazione guadagnato:
-15 answer unaccepted
-10 answer unupvoted
-5 question unupvoted
-2 answer downvoted
-2 question downvoted
-2 unaccept answer
-1 downvote answer
+1 join website
+1 undownvote answer
+2 accept answer
+2 question undownvoted
+2 answer undownvoted
+5 question upvoted
+10 answer upvoted
+15 answer accepted
+100 association bonus
Che tipo di privilegi?
Ecco un elenco di privilegi, in ordine di reputazione richiesta.
1 create posts
5 participate in meta
10 remove new user restrictions
10 create wiki posts
15 vote up
15 flag posts
20 talk in chat
50 comment everywhere
75 set bounties
100 edit community wiki
100 create chat rooms
125 vote down
150 create tags
200 retag questions
250 view close votes
500 cast close and reopen votes
750 established user
1000 edit questions and answers
1000 create gallery chat rooms
1250 create tag synonyms
1500 approve tag wiki edits
2000 access to moderator tools
3500 protect questions
4000 trusted user
Ingresso
Input (su STDIN) sarà un elenco di eventi, uno per riga, esattamente come appaiono nel primo grafico (tranne per la quantità di reputazione). Una riga vuota rappresenta la fine dell'input. Ecco un esempio (alla fine dovrebbe esserci una riga vuota):
join website
association bonus
answer upvoted
answer upvoted
question upvoted
answer accepted
answer upvoted
accept answer
unaccept answer
question unupvoted
accept answer
question upvoted
Produzione
La prima riga di output (su STDOUT) dovrebbe indicare la quantità di rappresentanti accumulati. Ogni riga successiva dovrebbe elencare un privilegio guadagnato, esattamente come appare e nello stesso ordine del secondo grafico. L'output previsto per l'input sopra:
153 reputation
1 create posts
5 participate in meta
10 remove new user restrictions
10 create wiki posts
15 vote up
15 flag posts
20 talk in chat
50 comment everywhere
75 set bounties
100 edit community wiki
100 create chat rooms
125 vote down
150 create tags
Regole, restrizioni e note
Questo è il codice golf. Si applicano le regole standard per il golf.
(EDIT: poiché ho avuto due voci che accedono ai file, vorrei sottolineare che la lunghezza del file deve essere aggiunta alla lunghezza del codice come parte delle regole standard per il codice golf)