Skip to content
← Back to Community
Final Weekly Challenge #4
Profile icon
h
has Hacker Plan
DynamicSquid

Hi!

I'm back! And welcome to the last weekly challenge!

Huge thanks to everyone that participated last week! And congrats to the top 5!

  1. @Nayoar
  2. @MattDESTROYER
  3. @IMayBeMe
  4. @InvisibleOne
  5. @SpicedSpices

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!

Print hi to the console

Now that may seem simple, but it's the scoring guideline that makes this interesting. Each task is worth 1 point.

Tasks

Task 1: 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)

Bonus Points

+1 for completing first 4 tasks

+3 for originality and creativity

Rules:

  1. 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.
  2. You can't read from any files in the challenge, you can still create them tho :)

Hints:

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.

Have fun!

Comments
hotnewtop
Profile icon
QuickV

would this work for challenge 3? Also do you know how it works because I think I lucked out... I basically just messed around with backslashes until I got the answer xD.

Profile icon
DynamicSquid

@QuickV Yeah that works. I think the backslashes turn the numbers in their ASCII chars

Profile icon
QuickV

That's what I originally thought, which is why I tried messing around with backslashes :). Also it says the ascii code for "h" is 104, so idk if it does actually turn the numbers into their ASCII codes lol @DynamicSquid

Profile icon
MattDESTROYER

@QuickV ASCII for h is definitely 104 like you said, so you're right, that's not ASCII.

Profile icon
QuickV

lol :)... I originally did \104, and it resulted in a different letter, so I kept messing around with numbers until i got a solution :) @MattDESTROYER

Profile icon
MattDESTROYER

@QuickV Nice :)

Profile icon
QuickV
Profile icon
Aivoybia

@DynamicSquid i thought you couldn't have numbers..

Profile icon
QuickV

Yeah on task 4, I've only completed task 3 lol. @Aivoybia

Profile icon
JustA6

https://replit.com/@JustA6/hilang#main.hi made my own lang just for this :)

Profile icon
JustA6

@JustA6 h is a command that prints hi

Profile icon
DynamicSquid

@JustA6 Nice lol :) Except in your main.py file, there's a bunch of strings and numbers. You have to find some way of running your language without having your language present if that makes sense

Profile icon
JustA6

@DynamicSquid python bytecode here i come lmao

Profile icon
JustA6

@DynamicSquid i have a stupid idea i love it so much

Profile icon
JustA6
Profile icon
HannahMarill

Cool!

Profile icon
InvisibleOne

This challenge looks cool!

Profile icon
AlmightyDeaks

i know its a bit late but would this work:

h=True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True
i=True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True+True
print(chr(h)+chr(i))

Profile icon
Highwayman

Aw. aw man. I'm so sad. Could've done this all in two seconds. :/

#include <cstdio> const char * hi() { return __func__; } int main() { puts(hi()); }
Profile icon
Highwayman

oh wait does that even satisfy task5? No... hm. I could just do some implicit casting?
asjdaskjdhadkkk It's annoying, cause now that I think about it,

THE CALL OPERATOR IS AN OPERATORRRRRR jashdsfsakjh

and so is casting. :(

@Highwayman

Profile icon
DynamicSquid

@Highwayman __func__ is a macro right? Haven't considered macros when making the rules, so technically it would work? And I wouldn't consider the call operator an operator :)

But that solution, where it just prints the name of a function or file, was done so many times already :(

Profile icon
Highwayman

oof that's too bad. did anyone do stuff with a lot of implicit casting? I was thinking of something like that, and seemed like it would be interesting, if complicated. @DynamicSquid

Profile icon
DynamicSquid

@Highwayman I don't think so. There were some submissions that did basic implicit casting like turning true into 1 (they only got up to task 4), then doing some math to get the ASCII numbers for h and i, but that's about it for the submissions that used implicit casting

Profile icon
Highwayman

hum. that's too bad that would have been cool. Btw, how does one find old weeklys? I can't figure out how to search for an App tag or something.

@DynamicSquid

Profile icon
DynamicSquid

@Highwayman You can search by tags on Apps like this: replit.com/apps/tag. So if you want to view weekly #2 submissions, replit.com/apps/weekly2

Profile icon
Highwayman

ahhh cool thank you! @DynamicSquid

Profile icon
QuickV

Who won?

It's friday morning for me right now... Has anything been graded yet?

Profile icon
ch1ck3n
Profile icon
QuickV

sadly I can't find myself using the search button (probably because I didn't compete in all the weeks) lol @ch1ck3n

Profile icon
ch1ck3n

@QuickV well it seems that you haven't made ANY submissions to the challenges

Profile icon
DynamicSquid

@QuickV The reason you can't find yourself is because I haven't released the official results yet

Profile icon
QuickV

ah... ok lol @DynamicSquid

Profile icon
QuickV

I made a submission on week4 tho .-. @ch1ck3n

Profile icon
ch1ck3n

@QuickV oh ok

Profile icon
QuickV
Profile icon
MattDESTROYER
  1. You can't read from any files in the challenge...

Does reading a file's name count as reading from a file? Or is that allowed?

Profile icon
DynamicSquid

@MattDESTROYER You can read a file's name

Profile icon
QuickV

Does

String.fromCharCode(104, 105);

work for task 1, 2, and 3 as well?

Profile icon
DynamicSquid

@QuickV Yup!

Profile icon
QuickV

Can I print multiple hi's (each with its own solution), just to show what kinda ways I've thought of to print it :D @DynamicSquid

Profile icon
DynamicSquid

@QuickV Sure!

Profile icon
QuickV
Profile icon
QuickV

I just realized

that even if I don't figure out how to do task 4, I can still get points for creativity and originality :D.

Profile icon
Aivoybia

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 .getVarName();, public String toString() for java

Profile icon
DynamicSquid

@Aivoybia Yes, you can use getVarName and toString()

Profile icon
EpicRaisin

Will this work for Task 6?

console.log(Object.keys({hi: null})[0].toString())
Profile icon
DynamicSquid

@EpicRaisin No, it contains a number 0 and a literal null. It's interesting tho!

Profile icon
EpicRaisin

@DynamicSquid Now it doesn't :)

console.log(Object.keys({hi: {}})[Object.keys({}).length].toString())
Profile icon
DynamicSquid

@EpicRaisin Isn't this a map tho: {hi: {}}. Maps aren't allowed for Task 5 and 6

Profile icon
EpicRaisin

@DynamicSquid It's a JS object, is that the same thing?

Profile icon
DynamicSquid

@EpicRaisin I'm not referring to Object, I'm referring to {hi: {}}, which is a map

Profile icon
EpicRaisin

@DynamicSquid would {hi: Object} be a map?

Profile icon
DynamicSquid

@EpicRaisin yes, anything similar to {key: value} is a map

Profile icon
EpicRaisin

@DynamicSquid Darn it :(

The empty object doesn't count as a map though, does it?

Also, does assigning (=) count as an operator here?

Profile icon
DynamicSquid

@EpicRaisin You can use an empty object. Also you can use =

Profile icon
MrVoo

@DynamicSquid You can use empty things for task 6?

Profile icon
DynamicSquid

@MrVoo Empty object, yes. Empty array/string, no

Profile icon
MrVoo

@DynamicSquid Hm, what counts as an object in Python?

Profile icon
EpicRaisin

@MrVoo Dictionaries are basically the equivalent in Python

Profile icon
MrVoo

@EpicRaisin Maybe, but dynamic said this and that's kinda what dictionaries are...

yes, anything similar to {key: value} is a map

Profile icon
MrVoo

For task 6, are we allowed to use ASCII codes for operators somehow?

Profile icon
DynamicSquid

@MrVoo I'm not sure what you mean, example?

Profile icon
MrVoo

@DynamicSquid Like using chr() to represent a + sign

Profile icon
MrVoo

@DynamicSquid Also can we use built in math functions like add() for task 6

Profile icon
DynamicSquid

@MrVoo You can use chr(). You can also use add(), but that might not earn you a lot of creativity points

Profile icon
QuickV

After thinking about it for 30 minutes...

It turns out I can't do task 4 in JavaScript (with my current knowledge)

Though my JavaScript knowledge is nearly non-existant...
Profile icon
CodingElf66

Wait, what??? I am quite confused. For example, can you do this using Python as shown below?

print(''' 😂 😂 😂😂 😂 😂 😂 😂 😂 😂 😂 😂 😂 😂 😂 😂 😂 😂 ''')

It's writing "hi", right? But just using emojis XD 😂😂😂😂😂😂😂

Profile icon
QuickV

I believe it has to print the letters h and i like how you would normally type them... (not emojis lol, but nice idea :D) @JeffreyChen13

Profile icon
Aivoybia

is this. and private and return and new break any rule? in java btw

if not am I allowed to take an input?

Profile icon
DynamicSquid

@Aivoybia You can use those keywords

Profile icon
Aivoybia

@DynamicSquid how abt input

Profile icon
Aivoybia

@DynamicSquid oh wait i forgot. can i use .getVarName(); for java

Profile icon
MrVoo

Could we use pi from the Python math module for task 4+, or are no numbers at all allowed?

Profile icon
DynamicSquid

@MrVoo You can use pi

Profile icon
QuickV

Would something like:

var 🤔 = "h" var | = "i" console.log(🤔); console.log(|);

work for task 4?

Profile icon
DynamicSquid

@QuickV No, letters are not allowed for Task 4.

I think you misunderstood, letters are allowed for variable names, it's just letter values like "h" are not allowed

Profile icon
QuickV

Ah... That makes more sense :) @DynamicSquid

Profile icon
Bunnytoes

how many times do you have to write 'hi'?

Profile icon
DynamicSquid
Profile icon
Bunnytoes

@DynamicSquid I saw sixbeeps' and thought I had to do 6

Profile icon
MrVoo

Is a literal a string, or any value?

Profile icon
DynamicSquid

@MrVoo A literal is just another word for value. That includes numbers, characters, strings, etc.

Profile icon
MrVoo

@DynamicSquid So a letter literal would be "MrVoo"?

Profile icon
DynamicSquid

@MrVoo Yes

Profile icon
MrVoo

@DynamicSquid So is "123bonk"?

Profile icon
DynamicSquid

@MrVoo Yes. A letter literal is a string or character than contains letters.

Profile icon
MattDESTROYER

In JavaScript is an empty function allowed for task 6 e.g.:

function empty() { // empty function }
Profile icon
DynamicSquid
Profile icon
MattDESTROYER

@DynamicSquid Alright then my solution is valid! :D Thanks!

Profile icon
Bunnytoes

can task 6 have literals

Profile icon
DynamicSquid
Profile icon
QuickV

Does it have to be lowercase hi or can it be uppercase HI?

Profile icon
DynamicSquid

@QuickV lowercase

Profile icon
QuickV
Profile icon
ch1ck3n

is task 5 and 6 even possible

Profile icon
DynamicSquid

@ch1ck3n ofc :)

Profile icon
ch1ck3n

@DynamicSquid i would like to see a solution to task 6

Profile icon
DynamicSquid

@ch1ck3n no. instead go to https://replit.com/apps/weekly4 for inspiration

Profile icon
fuzzyastrocat

@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.

Profile icon
DynamicSquid

@fuzzyastrocat Not really, there's many ways to do it :) An easier way is to get the number 1, then use math

Profile icon
fuzzyastrocat

@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)

Profile icon
DynamicSquid

@fuzzyastrocat Math functions. And it would be waay too hard if . was an operator!

Profile icon
fuzzyastrocat

@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 2 be allowed while 1 + 2 is 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.)

Profile icon
DynamicSquid

@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

Profile icon
SixBeeps

@DynamicSquid Are you counting = as an operator if used to assign a variable?

EDIT: nvm i can read

Profile icon
Bunnytoes

does string count as a keyword operator

Profile icon
DynamicSquid

@Bunnytoes i'm not sure what you mean by "string". example?

Profile icon
Bunnytoes

@DynamicSquid I mean the variable type and I figured something else out

Profile icon
DynamicSquid

@Bunnytoes I meant keyword operator as and, not (like the ones in Python)

Profile icon
Bunnytoes

@DynamicSquid ok,thanks

Profile icon
Bunnytoes

@DynamicSquid is unicode a literal?

Profile icon
DynamicSquid

@Bunnytoes Yes, it also contains letters and characters which isn't allowed for Task 2

Profile icon
Bunnytoes

@DynamicSquid what about task 5?

Profile icon
DynamicSquid

@Bunnytoes Well you can only do Task 5 if you do Task 2, so if Task 2 doesn't allow letters, then Task 5 also doesn't allow letters

Profile icon
Bunnytoes
Profile icon
Bunnytoes

@DynamicSquid can I use empty strings?

Profile icon
DynamicSquid

@Bunnytoes For Task 5 and 6, no. For Task 4 and under, yes.

Profile icon
Bunnytoes

@DynamicSquid ok, thanks

Profile icon
plscodeinjava

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

Profile icon
DynamicSquid

@plscodeinjava Literal is just a value, like 'h' or 5. Also, try reading up on ASCII codes for some help :)

Profile icon
plscodeinjava

@DynamicSquid
what's an ascii code?
so if a literal is "h", you are saying that if i

print("hi")

its not alowed?

Profile icon
DynamicSquid

@plscodeinjava

what's an ascii code?

That's why I suggested to look it up :)

And for Task 2, print("hi") is not allowed because it contains the letter literals: "hi"

Profile icon
Dunce

@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 h and i, one of the easiest ways to accomplish this is probably through ASCII codes.

Profile icon
plscodeinjava

@DynamicSquid oh rip
yeah uhh all of these challenges are impossible unless ur like a super genius

Profile icon
Aivoybia

wdym by character literals and letter literals and number literals?

Profile icon
DynamicSquid

@Aivoybia Values, like 'c' or 5

Profile icon
Aivoybia

@DynamicSquid and i cant have letters or numbers in strings?
I can have it in the main code right?
like if I do print() in python i use letters
if i do print() plus "hi" i would break one of the first 4 rules?

Profile icon
Aivoybia

@DynamicSquid but i cant have numbers in the main code?

Profile icon
DynamicSquid

@Aivoybia I'm not sure what you mean by "main code". You can definitely use letters and numbers in your variable names, functions, etc.

Profile icon
Aivoybia

if i want to follow the first 4 rules @DynamicSquid

Profile icon
Aivoybia

@DynamicSquid also is using len() breaking rule 6

Profile icon
Aivoybia

@DynamicSquid sorry for so many questions but is a dictionary counted as a list?
is : a symbol?

Profile icon
DynamicSquid

@Aivoybia You can use len() for Task 6.

Also dictionary is a map, and is not allowed for Task 5 or 6.

Profile icon
Aivoybia

@DynamicSquid but does len break any other rules?

Profile icon
DynamicSquid
Profile icon
tankerguy1917

So far, doing the task is the easy part, being creative is the hard part.

Profile icon
DynamicSquid
Profile icon
tankerguy1917

@DynamicSquid for task 4, does it count against us if we use numbers to get a value from a list, like list_name[0]?

Profile icon
DynamicSquid

@tankerguy1917 Yes, that's a number. So no, you can't use it for task 4.

Profile icon
QuickV

My brain stopped working at task 2.

Profile icon
DynamicSquid

@QuickV ascii :)

Profile icon
QuickV
Profile icon
DynamicSquid

@QuickV No, ascii codes :)

Profile icon
QuickV

OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO @DynamicSquid

Profile icon
GhostKing007

Does = count as an operator, and if so, is it allowed while making variables? (With respect to Task 6)

Profile icon
DynamicSquid

@GhostKing007 No, = is not an operator

Profile icon
GhostKing007
Profile icon
GhostKing007

@DynamicSquid So, uh two more questions, one : can I use empty strings (''), and two : do the numbers used for array indices count as number literals and/or break any rules of the tasks?

Profile icon
DynamicSquid

@GhostKing007 You can use empty strings for Task 1, 2, 3, 4. For Task 5 and 6, you can't use empty strings.

And yes, the numbers used for array indices count as numbers, so you can't use them for Task 4, 5, or 6.

Profile icon
GhostKing007

@DynamicSquid ah...okay thanks