PDA

View Full Version : Programmers’ Day



BB_Sious
13.09.18, 13:35
Dear Settlers,

Today is the day of the programmer. Have you always wondered how codes look like and how they even work?
Well, you can try to solve the following Code even without being a programmer.

https://ubistatic-a.akamaihd.net/0034/int/website/pictures/2018_08_01_worldwideweb.png
Give it a try and solve the Code. Post your answer in this thread.

Note: Answers will stay hidden until September 17th at 13:00 CEST, this way everyone has a chance to become a coder.



// If you can read this code, tell your Community Manager the secret word and win a small prize.

Var Prize_Crystals
Var reverse = function(s) {
return s.split (“”)reverse( ).join(“”);
}
Var communitymanager = {
Str1: “al”,
Str2: reverse(“hti”)
Str3: reverse(“tne”)
Str4:reverse(“nro”)
Str5: “am”,
Str6:reverse(“ms”)

request: function(preference) {
return preference + “. Secret word: “
+thisstr4+thisstr5+thisstr3+thisstr1+thisstr6+this str2;
}
};
communitymanager.request (Prize_Crystals)



Please note this is just a small "look" into a very complex theme. It is, in fact, not a "real" working code ;)

ho11ub
13.09.18, 15:41
ornamentalsmith

Ravise
13.09.18, 16:29
Parse error: syntax error, unexpected T_STRING, expecting T_OBJECT_OPERATOR in programmers_day_challenge on line 5.

But I guess you want to hear ". Secret word: ornamentalsmith"

PS: unused variables Prize_Crystals, Str1, Str2, Str3, Str4, Str5, Str6. Undeclared variables Prize_Crystal, thisstr1, thisstr2, thisstr3, thisstr4, thisstr5, thisstr6. Calling reverse() causes an infinite loop. This is indeed not a working code. And don't get me started about your coding style :D

Minorek
13.09.18, 17:01
ornamentalsmith

Rines
13.09.18, 17:35
Secret word: ornamentalsmith

Martc
13.09.18, 17:42
Secret word: ornamentalsmith

But with assumption that your language has same rules like javascript the result will be "undefined". Because Prize_Crystals variable has undefined value and undefined + ". Secret word: ornamentalsmith" = "undefined"

Marabu0
13.09.18, 18:07
Hi, there is my guess:

ornamental smith

Florianek64
13.09.18, 18:08
ornamentalsmith

sopticek64
13.09.18, 18:09
ornamentalsmith

maris1de
13.09.18, 18:22
my eyes are bleeding, so let's try..
Prize_Crystal. Secret word: ornamenalsmith

runner
13.09.18, 18:28
ornamentalsmith

POPEYEcz
13.09.18, 18:32
HI,

I think, the secrect words is "ornamental smith".

Ticho--Brahe
13.09.18, 18:54
Answer is: undefined. Secret word: ornamentalsmith


It looks at as very abstract code :-) and I guess that in some parts of code missing dots (for better understanding).



--------------------------
Vypadá to jako velmi abstraktní kód. :-) a řekl bych, že v některých částech chybí tečky (pro lepší pochopení).

kvakynka
13.09.18, 18:55
tentostrs

ApolloKV
13.09.18, 19:04
Hello, answer is: ornamental smith.

jsvelta
13.09.18, 19:15
Secret word: ornamentalsmith

ApolloKV
13.09.18, 19:29
the whole sentence:
. Secret word: ornamentalsmith

Franta_Vorech
13.09.18, 20:01
Hi, the Secret word is "ornamentalsmith"

Traminek
13.09.18, 20:19
ornamentalsmith

hovaddko
13.09.18, 22:07
ornamental smith

LosAngel
13.09.18, 22:09
Secret word: ornamentalsmith

hovaddko
13.09.18, 22:14
ornamental smith

KHSnorlax
13.09.18, 23:22
ornamentalsmith

tazik
14.09.18, 06:39
ornamentalsmith

Skali
14.09.18, 06:50
ornamentalsmith

SwordfishCZ
14.09.18, 07:07
Hello,
I think, that result of this code would be compile error. I don´t know your language, but I have some experience with other languages, so I think, that there's "dot" missing on line 5


return s.split (“”).reverse( ).join(“”);


and also "dots" missing on line17 in all those "class variables"

+this.str4+this.str5+this.str3+this.str1+this.str6 +this.str2;

I don't know if your language is has case sensitive variables ("this.str4" vs "this.Str4") so I'll not comment this.

Anyway if the code somehow compiles, the outcome would be (text in quotes): ". Secret word: ornamentalsmith"

Have a nice day
SwordfishCZ

Ing_Ignac
14.09.18, 07:24
ornamental smith

Misikozisek
14.09.18, 07:37
ornamentalsmith

benko123123
14.09.18, 07:55
. Secret word: ornamentalsmith

jozef1885
14.09.18, 09:31
. Secret word: ornamentalsmith

DjJakub
14.09.18, 09:39
ornamentalsmith

Von_Dragon
14.09.18, 09:50
Prize_Crystal. Secret word: ornamentalsmith

Quasimodo666
14.09.18, 09:51
Ornamental smith

katsyu
14.09.18, 12:59
ornamentalsmith

Conan
14.09.18, 20:35
ornamentalsmith

Dolgin
14.09.18, 21:15
ornamentalsmith

Settleric
14.09.18, 21:17
. Secret word: ornamentalsmith

Kralyks1234
14.09.18, 21:34
ornamental smith

Ahita
14.09.18, 21:42
ornamental smith

Chron
14.09.18, 21:53
CZECH: Ten kód sice tak, jak je napsaný nemůže fungovat snad v žádném programovacím jazyce, ale to byl asi záměr. To tajné slovo (Secret word) je "ornamentalsmith".
ENGLISH: I think the code can't work in any programming language, but I believe that was on purpouse. The secret word is "ornamentalsmith".

Florianek64
14.09.18, 22:22
ornamentalsmith

Tararingapatan
15.09.18, 01:10
Secret word: ornamentalsmith

smongi
15.09.18, 05:57
Secret word: ornamentalsmith

Jarouch78
15.09.18, 07:00
ornamentalsmith

madmaf
15.09.18, 08:11
ornamentalsmith

Permon
15.09.18, 08:55
secret word: ornamental smith

MarkFreeman
15.09.18, 09:02
ornament alsmith

Nexal
15.09.18, 13:06
Prize_Crystals. Secret word: ornamentalsmith

PAsettler
15.09.18, 16:03
ornamental smith

ARNOR
16.09.18, 11:38
ornamentalsmith

czbacil
16.09.18, 17:45
ornamental smith

BoudaX
17.09.18, 06:27
Ornamentalsmith

warth
17.09.18, 06:38
ornamentalsmith

Rakato
17.09.18, 06:53
ornamental smith

Petroff
17.09.18, 09:25
Hello
I made a working code (javascript; verified as a web page in browser GoogleChrome)
Secret word: ornamentalsmith

CODE:

<script>
var Prize_Crystals;
var reverse = function(s) {
return s.split("").reverse().join("");
}
var communitymanager = {
str1: "al",
str2: reverse("hti"),
str3: reverse("tne"),
str4: reverse("nro"),
str5: "am",
str6: reverse("ms"),

request: function(preference) {
return preference + ". Secret word: " + this.str4 + this.str5 + this.str3 + this.str1 + this.str6 + this.str2;
}
}
Prize_Crystals = ":-) I won 20 crystals";
var solution = communitymanager.request (Prize_Crystals);
alert(solution);
</script>

Petroff

Sir_Balthazar
17.09.18, 10:01
Prize_Crystals. Secret word: ornamental smith

Barbaridor
17.09.18, 10:47
ornamental smith ;)

veXla
17.09.18, 12:10
Ornamentalsmith

BB_Sious
17.09.18, 15:14
Dear settlers,

We hope you enjoyed your time figuring out the secret word from our fictitious code.

The code we are looking for is ornamentalsmith. Ornamental smith is also acceptable.

Players who got the correct answer will receive the prize via their in-game mail.

Thank you for your participation.

Happy Settling!
BB_Sious