You dudes, the Most Excellent Adventure is a home brew roleplaying game system based on the Bill & Ted Films, plays gnarly air guitar riff.
In this game system, when you draw from your dice pool (you have between 1 and 12 ten-sided dice, with faces labelled 0-9) you need to connect the results as a phone number on your phone pad:
Here one person has rolled 4, 2, 8, 3, 8, and 2, dialling 3-2-2-4-8-8. The other 7, 4, 6, 3, 9, and 4, only dialling 4-4-7 or 3-6-9. And the longest number wins.
Bill and Ted want to play this game on their telephone kiosk, but haven't the first clue about programming. As Station isn't around, they want you to program it. The kiosk had access to all programming languages and OSs past and future (causality forbids you using any future technology... No imaginary python 7 !)
Your input is two numbers between 1 and 12, representing the number of dice player 1 and player 2 have respectively. The output is the result for each player, and the length of the largest number they could dial.
Input: 8 10
Output:
Player 1 rolled 1 2 3 4 5 6 7 8 with longest dialable number of 8.
Player 2 rolled 8 8 8 2 3 1 4 0 3 3 with longest dialable number of 10.
Numbers can be reordered and pressing the same key twice counts as two digits (which is why the above sequence 8 8 8 2 3 1 4 10 3 3
makes a six digit number not a 4 digit number)
Also, as you're programming this in a telephone kiosk you can only access 0-9, a-z, the *
and a #
keys in your code. Letters are accessed by repeated typing, much like on a mobile phone. Every other key must be input in the kiosk as its ASCII code in hex like so: #0a
the upshot is when scoring your submission, these keys "cost" three times as many.[Unclear / Incorrect?]
For instance to type ~
you press the hash key once, the 7
and then 3
three times to cycle through the digits 3de
. This gives the code #7e
which corresponds to ~
. When you upload you code here you can just type the ~
, and count it as five characters.
The keypad looks a little like this:
For instance If your code had print()
that would cost 15 for the print
(7p 7pqr 4ghi 6mn 8t
) plus 6 for the ()
(#28 #29
).
This is code golf as Bill and Ted will get bored otherwise. Let the coding commence plays gnarly air guitar riff.
0123456789ab*#
rules out even the esoteric languages most commonly used on this site. You'll be lucky to get one answer, let alone two. PS What d10s are you using which have10
rather than0
? \$\endgroup\$