Updates from the Repl.it team about the product

← Back to all posts
Final Weekly Challenge #4
DynamicSquid (5068)

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
QuickV (197)

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.

DynamicSquid (5068)

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

QuickV (197)

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

MattDESTROYER (28)

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

QuickV (197)

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

Aivoybia (42)

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

QuickV (197)

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

JustA6 (5)

@JustA6 h is a command that prints hi

DynamicSquid (5068)

@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

JustA6 (5)

@DynamicSquid python bytecode here i come lmao

JustA6 (5)

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

InvisibleOne (3263)

This challenge looks cool!

Highwayman (1537)

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

Highwayman (1537)

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

DynamicSquid (5068)

@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 :(

Highwayman (1537)

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

DynamicSquid (5068)

@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

Highwayman (1537)

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

DynamicSquid (5068)

@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

QuickV (197)

Who won?

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

QuickV (197)

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

ch1ck3n (2866)

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

DynamicSquid (5068)

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

QuickV (197)

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

MattDESTROYER (28)
  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?

QuickV (197)

Does

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

QuickV (197)

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

QuickV (197)

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.

Aivoybia (42)

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

DynamicSquid (5068)

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

EpicRaisin (276)

Will this work for Task 6?

DynamicSquid (5068)

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

EpicRaisin (276)

@DynamicSquid Now it doesn't :)

DynamicSquid (5068)

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

EpicRaisin (276)

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

DynamicSquid (5068)

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

EpicRaisin (276)

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

DynamicSquid (5068)

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

EpicRaisin (276)

@DynamicSquid Darn it :(

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

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

DynamicSquid (5068)

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

MrVoo (190)

@DynamicSquid You can use empty things for task 6?

DynamicSquid (5068)

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

MrVoo (190)

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

EpicRaisin (276)

@MrVoo Dictionaries are basically the equivalent in Python

MrVoo (190)

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

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

MrVoo (190)

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

DynamicSquid (5068)

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

MrVoo (190)

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

MrVoo (190)

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

DynamicSquid (5068)

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

QuickV (197)

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...
CodingElf66 (321)

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 😂😂😂😂😂😂😂

QuickV (197)

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

Aivoybia (42)

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

if not am I allowed to take an input?

DynamicSquid (5068)

@Aivoybia You can use those keywords

Aivoybia (42)

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

MrVoo (190)

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

QuickV (197)

Would something like:

work for task 4?

DynamicSquid (5068)

@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

QuickV (197)

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

Bunnytoes (231)

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

MrVoo (190)

Is a literal a string, or any value?

DynamicSquid (5068)

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

MrVoo (190)

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

DynamicSquid (5068)

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

MattDESTROYER (28)

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

QuickV (197)

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

ch1ck3n (2866)

is task 5 and 6 even possible

ch1ck3n (2866)

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

fuzzyastrocat (1896)

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

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

fuzzyastrocat (1896)

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

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

fuzzyastrocat (1896)

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

DynamicSquid (5068)

@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

SixBeeps (5627)

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

EDIT: nvm i can read

Bunnytoes (231)

does string count as a keyword operator

DynamicSquid (5068)

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

Bunnytoes (231)

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

DynamicSquid (5068)

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

DynamicSquid (5068)

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

DynamicSquid (5068)

@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

DynamicSquid (5068)

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

plscodeinjava (406)

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

DynamicSquid (5068)

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

plscodeinjava (406)

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

its not alowed?

DynamicSquid (5068)

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

Dunce (71)

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

plscodeinjava (406)

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

Aivoybia (42)

wdym by character literals and letter literals and number literals?

Aivoybia (42)

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

Aivoybia (42)

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

DynamicSquid (5068)

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

Aivoybia (42)

if i want to follow the first 4 rules @DynamicSquid

Aivoybia (42)

@DynamicSquid also is using len() breaking rule 6

Aivoybia (42)

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

DynamicSquid (5068)

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

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

Aivoybia (42)

@DynamicSquid but does len break any other rules?

tankerguy1917 (180)

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

tankerguy1917 (180)

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

DynamicSquid (5068)

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

QuickV (197)

My brain stopped working at task 2.

QuickV (197)

OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO @DynamicSquid

GhostKing007 (155)

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

GhostKing007 (155)

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

DynamicSquid (5068)

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

Whippingdot (718)

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.

TheDrone7 (2001)

@Whippingdot the challenge is not supposed to be completed within a day or so. We say these are weekly challenged because for an average beginner, it will take 4-5 days of research and coding to complete them which is why we give 1 week of time.

Whippingdot (718)

Yea - and I do use that time. i have been working on each challenge at least from Monday (mostly Sunday). Which part of this comment were you replying to? @TheDrone7