33
2
A man from the stars has come to Earth! Luckily the president of the United States, Donald Trump, has an infinity-sided die. Using this die, he can conjure up a number which you, the mayor of Podunk, must use to determine who should be sent to stop the invader! But be careful, you can only send a limited amount of bytes on the back of your frog!
Given a user input (which will be a positive integer), you must return a string depending on what category the number is in.
- If the number is a Fibonacci number, you must output Ness.
- If the number is a Lucas number, you must output Lucas.
- If the number is both a Lucas number and a Fibonacci number, you must output Travis.
- If the number is neither a a Lucas number nor a Fibonacci number, you must output Pippi.
Examples
Here are a bunch of test cases:
1 => Travis 2 => Travis 3 => Travis 4 => Lucas 5 => Ness 6 => Pippi 7 => Lucas 8 => Ness 610 => Ness 722 => Pippi 843 => Lucas
Rules
- This is code-golf, the shortest answer in bytes wins.
- You program may be a full program or a(n anonymous) function.
Bonuses
There are a couple bonuses that you can use to help your frog get the data to President Trump faster:
- For
-15
bytes: If the input number is2016
, you must outputTrump
, as he is at the peak of his presidency.
29For the record, I am not one of those Starmen. – El'endia Starman – 2015-11-22T00:15:01.300
1Giygas isn't happy about this (ctrl+f "Giygas") – Cilan – 2015-11-22T00:27:05.320
@DavidCarraher Just like how some definitions start the Fibonacci series off with
– Sp3000 – 2015-11-22T01:44:30.0430, 1
while others start with1, 1
, I believe this depends on the definition you use. It's not uncommon to see the Lucas numbers start with2, 1
, e.g. OEIS has both versions (1, 2), but the one starting with 2 is the definition phase has gone with.phase: is there an upper limit to the input? – lirtosiast – 2015-11-22T02:05:29.053
Sp3000, I was unaware that there was more than one Lucas sequence. I was using the second version, that has no 2 in it! – DavidC – 2015-11-22T02:34:30.350
@ThomasKwa Expect an unsigned integer (or whatever the normal Number is for your language) – phase – 2015-11-22T02:48:26.397
@DavidCarraher, Sp3000: there's only one Fibonacci sequence and one Lucas sequence, but they're both doubly infinite. – Peter Taylor – 2015-11-22T09:01:16.443
2Votes are supposed to be hidden, but I'll still say I really don't like politics and that it has affected my voting on this question. Would the asker mind removing politics from the question or at least explain me any pun I may have missed? A political reference is baked into the spec for good, but it can still be removed from the title. – John Dvorak – 2015-11-22T19:38:25.987
What's the largest number that needs to be handled before overflow? – Downgoat – 2015-11-22T20:46:54.017
@Vɪʜᴀɴ Just whatever the normal integer is for your language. – phase – 2015-11-22T21:59:24.467
3@JanDvorak: I think it's very tongue-in-cheek. For example, consider that presidential terms are 4 years, and that the next election is in November 2016. If Trump is at the peak of his presidency in 2016... – El'endia Starman – 2015-11-23T22:47:50.760
We need a Trumpscript answer to this challenge – WizardOfMenlo – 2016-01-22T19:46:26.830
Well, it appears this challenge predicted the next president, though they got the term wrong. – mbomb007 – 2016-12-01T20:43:46.237