Final Weekly Challenge #4
I'm back! And welcome to the last weekly challenge!
Huge thanks to everyone that participated last week! And congrats to the top 5!
Remember, the winner gets free hacker plan for a month! And even if you don't win, it's still fun to participate!
Now let's get right into the final challenge!
hito the console
Now that may seem simple, but it's the scoring guideline that makes this interesting. Each task is worth 1 point.
hi is displayed to the console
Task 2: code does not contain letter literals
Task 3: code does not contain character literals (ex. letters, symbols)
Task 4: code does not contain numbers
Task 5: code does not contain literals (ex. booleans, numbers, characters, strings) or arrays (ex. tuples, vector, list, map, set, initializer lists)
Task 6: code does not contain operators (ex. arithmetic, boolean, binary, keyword operators)
+1 for completing first 4 tasks
+3 for originality and creativity
- To earn points for a task, you have to complete the previous tasks first. So you can only earn points for Task 2 if you do Task 1.
- You can't read from any files in the challenge, you can still create them tho :)
Hint: if you're stuck on a task, read the next task, because each task will tell you exactly what to do for the previous task :)
Hint: For the first few tasks, read up on ASCII, and maybe try adding symbols together...
Hint: For Task 4 and up, get the number 1. Once you have the number 1, you can practically get any other number
Remember you get up to 3 points for originality/creativity, so even if you can only do the first 3 tasks, make your solution stand out. For example push the boundaries of your language by using niche features.
To submit your repl, post it on Apps with the tag
weekly4. Submission deadline is Friday morning next week.
i wont get a lot of points if I have
hi as a string in my code right?
say I do task one, but not two and three, but 4 5 and 6. I wont get points for those right?
also I know I posted this already but in case you didn't see it, can i use
public String toString() for java
Wait, what??? I am quite confused. For example, can you do this using Python as shown below?
It's writing "hi", right? But just using emojis XD 😂😂😂😂😂😂😂
@ch1ck3n I don't think task 5/6 is possible without using some kind of clever hacky thing — without any form of operators or literals I'm fairly certain it's impossible to construct arbitrary strings, so you have to use some kind of language that allows an unorthodox workaround (which, mind you, is very possible). I may be corrected though.
@DynamicSquid You can't use math if no operators are allowed
Basically I think it comes down to, "use a clever hack" (cleverest one I've seen so far is the Hawaii postal abbreviation) or "use a language where the definition of 'operator' is lenient" (i.e smalltalk or even Java where lots of things are done OO-wise, and for some reason people don't consider
. an operator)
@DynamicSquid And how are those math functions defined? Either...
- You have to define them yourself, in which case you can't do that since you need
-, etc to define such functions. Chicken-and-egg problem
- The math function comes bundled with the language. This fits with my second point above — what's the difference between a math function and a math operator? It's just a leniency in the definition of "operator". (For instance, consider haskell where there is no distinction between "function" and "operator". Would
(+) 1 2be allowed while
1 + 2is not? That seems rather unreasonable.)
I mean, I see your point about it being too hard if
. was considered an operator (so that's a justified approach to solving the problem). (But of course from a language standpoint it is an operator.)
@fuzzyastrocat I'm talking about pre-defined math functions. Also math functions encompass way more mathematical functionality than the operators a language provides.
For your point on Haskell, I don't think anyone submitted code in Haskell for the past 3 weeks, so I assumed no one was going to do that now
this is so difficult
and im confused
what in the world is a literal
and this is another impossible challenge
how am i supposed to get hacker
@plscodeinjava Literals are any hardcoded values. So if I directly inserted the number
5 into my code that would be a literal, but if I got a number from the return value of a function that would not be a literal.
behind the scenes computers represent characters in the form of numbers, as such there are standards for which numbers represent which characters, one of those standards is ASCII.
So no, something like
print("hi") is not allowed. You'll have to come up with a clever way of getting the values
i, one of the easiest ways to accomplish this is probably through ASCII codes.
Does = count as an operator, and if so, is it allowed while making variables? (With respect to Task 6)
Hey, @TheDrone7 sorry I didn't finish the weekly challenge 3. I know you don't care but I was working on it but it was just too hard. I am going to correct my program today with my dad (it feels like cheating if I use him while the weekly challenge is going on) and I am going to see if I can finish it. After I am done I would give you the program but it doesn't really matter cause I didn't make it.
Anyway, I don't think I will be able to do this challenge either (seems too hard - like how do you print hi without using characters or letters - I am not THAT skilled yet). I think I am just going to learn some C++. Be back next week!
Also, one thing about August, I have important exams so I might not be able to do the last week. I know this might be a far stretch but if I do happen to do very well in the first 3, will I just lose cause I can't do one?
Also, do the challenges get harder and harder? It really seems so.