##### Final Weekly Challenge #4

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!

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!

`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:**

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

**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!

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

@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

@DynamicSquid python bytecode here i come lmao

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

@DynamicSquid request granted https://replit.com/@JustA6/hilang-stupid#main.py

Cool!

This challenge looks cool!

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

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()); }`

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 `__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 :(

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

@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

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.

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

ahhh cool thank you! @DynamicSquid

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

ah... ok lol @DynamicSquid

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

@MattDESTROYER You can read a file's name

@QuickV Yup!

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 Sure!

k :D... @DynamicSquid

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

@Aivoybia Yes, you can use `getVarName`

and `toString()`

Will this work for Task 6?

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

@EpicRaisin No, it contains a number `0`

and a literal `null`

. It's interesting tho!

@DynamicSquid Now it doesn't :)

`console.log(Object.keys({hi: {}})[Object.keys({}).length].toString())`

@EpicRaisin Isn't this a map tho: `{hi: {}}`

. Maps aren't allowed for Task 5 and 6

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

@EpicRaisin I'm not referring to `Object`

, I'm referring to `{hi: {}}`

, which is a map

@DynamicSquid would `{hi: Object}`

be a map?

@EpicRaisin yes, anything similar to `{key: value}`

is a map

@DynamicSquid Darn it :(

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

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

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

@DynamicSquid You can use empty things for task 6?

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

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

@MrVoo Dictionaries are basically the equivalent in Python

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

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

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

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

@DynamicSquid Like using `chr()`

to represent a + sign

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

@MrVoo You can use `chr()`

. You can also use `add()`

, but that might not earn you a lot of creativity points

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

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

is `this.`

and `private`

and `return`

and `new`

break any rule? in java btw

if not am I allowed to take an input?

@Aivoybia You can use those keywords

@DynamicSquid how abt input

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

for java

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

@MrVoo You can use pi

Would something like:

`var π€ = "h" var | = "i" console.log(π€); console.log(|);`

work for task 4?

@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

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

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

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

Is a literal a string, or any value?

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

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

@DynamicSquid So is "123bonk"?

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

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

`function empty() { // empty function }`

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

can task 6 have literals

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

@QuickV lowercase

is task 5 and 6 even possible

@ch1ck3n ofc :)

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

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

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

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

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

@fuzzyastrocat Math *functions*. And it would be waay too hard if `.`

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

@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

@DynamicSquid Are you counting `=`

as an operator if used to assign a variable?

EDIT: nvm i can read

does string count as a keyword operator

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

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

@Bunnytoes I meant keyword operator as `and`

, `not`

(like the ones in Python)

@DynamicSquid ok,thanks

@DynamicSquid is unicode a literal?

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

@DynamicSquid what about task 5?

@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 can I use empty strings?

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

@DynamicSquid ok, thanks

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 Literal is just a value, like `'h'`

or `5`

. Also, try reading up on ASCII codes for some help :)

@DynamicSquid

what's an ascii code?

so if a literal is "h", you are saying that if i

`print("hi")`

its not alowed?

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

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

@DynamicSquid oh rip

yeah uhh all of these challenges are impossible unless ur like a super genius

wdym by character literals and letter literals and number literals?

@Aivoybia Values, like `'c'`

or `5`

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

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

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

if i want to follow the first 4 rules @DynamicSquid

@DynamicSquid also is using len() breaking rule 6

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

is : a symbol?

@Aivoybia You can use `len()`

for Task 6.

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

@DynamicSquid but does len break any other rules?

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

@tankerguy1917 yup :)

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

?

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

My brain stopped working at task 2.

@QuickV ascii :)

like |-| | [email protected]

@QuickV No, ascii *codes* :)

OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO @DynamicSquid

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

@GhostKing007 No, `=`

is not an operator

ah ok pog @DynamicSquid

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

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

@DynamicSquid ah...okay thanks

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.

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

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

@QuickV

`ASCII`

for`h`

is definitely`104`

like you said, so you're right, that's not`ASCII`

.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

@QuickV Nice :)

lol :) @MattDESTROYER

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

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