1
1
Introduction
You started to write a "Hello, World!" program, but after you wrote the part to print the hello, you forgot what your program should actually print. So now, you somehow managed it to write a program which can check if the entered word is what you search.
The task
Your task is to write a program or function, which first prints Hello... eh, whom should I greet?, then asks for input, and if the input equals world ignoring capitalization, the program should print Ah, yes. World., else it should print No. That isn't what I meant..
But you are not allowed to use any of the bytes equivalent to the ASCII values of:
worldWORLD
- that is, for those using code-pages not aligned with ASCII, bytes:
0x...: 77, 6f, 72, 6c, 64, 57, 4f, 52, 4c, 44.
Compact rules
No substring of the byte-string
worldWORLDmay appear in your program or in the file name of the program on any wayprint "Hello... eh, whom should I greet?"; if input.lower == "world" print "Ah, yes. World."; else print "No. That isn't what I meant.";Leading or trailing spaces are ignored.
This is a code-golf challenge, so the program with the lowest amount of chars wins!
1@CartManagerXD Why shouldn't you? Just write a function which does the task. In most languages, it isn't of any use, but in C, for example, you can save three bytes by naming your function different then
main– Mega Man – 2017-04-23T18:30:45.6201@JonathanAllan Oh sorry. I live in Germany, so sometimes I forget those simple things XD – Mega Man – 2017-04-23T18:36:58.887
@CartManagerXD Yeah, that's what I mean. The code doesn't have to be runnable, if it's a valid function definition. – Mega Man – 2017-04-23T18:38:32.700
"But you are not allowed to use any of the chars w, o, r, l or d in any capitalization in your program." - what if my language doesn't use any of these characters? Or rather, what if it uses raw bytes rather than characters? – John Dvorak – 2017-04-23T18:44:41.563
@JanDvorak Well, then you're lucky. The chars are needed in the string "world", which appears at least one time, but if you found a way to ignore that, you solved the question :D – Mega Man – 2017-04-23T18:46:35.633
7I've downvoted this challenge, because I don't think it's very easily golfable. There's not really more than 1 way to do this, which is
print string; input(); isequal? string1 : string2. It panders to golfing languages with those builtins not assigned toworldand with short names. – Rɪᴋᴇʀ – 2017-04-23T19:25:18.407@CartManagerXD Here is a functional equivalent of my below program submission, although it breaks FP best practices of avoiding sideeffects and non-argument data.
– Adám – 2017-04-24T00:26:52.517I've upvoted this challenge, as there is in fact a lot of ways to golf it. See Python 3 submissions in here.
– None – 2019-07-08T11:00:10.813