From CG community
Jump to navigation Jump to search

PatrickMcGinnisII: then write an output that you can cut/paste back into the ide

MaliciouslyCrypticUsername: ?

MaliciouslyCrypticUsername: You mean just hardcoding the solutions?

PatrickMcGinnisII: i forgot what det. pikaptcha was about

MaliciouslyCrypticUsername: =,=

MaliciouslyCrypticUsername: For each passage, find the number of adjacent passages

MaliciouslyCrypticUsername: THe way I'm doing it rn is calculating from every passage to each other passage, and counting the ones with a distance of 1.

PatrickMcGinnisII: like if i need the first 100 prime numbers in a quick lookup array, i would write code to generate the primes, output them in a format i can just cut/paste back into the IDE for the real program to use.

PatrickMcGinnisII: oh, lemme look... just a sec

PatrickMcGinnisII: which episode?

PatrickMcGinnisII: a 100x100 grid w/ a max of 5 if's per cell should never timeout

jrke: can anyone tell me an easy way to sort array in c++

PatrickMcGinnisII: umm, sort(a,asize); ?

jrke: and if i want to sort from arr.score

jrke: then is there any way

jrke: or i have to use vectors then?

MaliciouslyCrypticUsername: patrickmcginnisII I'm looping (number of passages)^2 times :sweat_smile:

MaliciouslyCrypticUsername: Are you saying I should just break after 100 iterations?

PatrickMcGinnisII: jrke you can define a function to use as a comparator or use vector


PatrickMcGinnisII: MaliciouslyCrypticUsername try a different method

MaliciouslyCrypticUsername: .-.

jacek: happy Caturday

eulerscheZahl: beat me by a blink of an eye

eulerscheZahl: was catching up with yesterday's chat first

eulerscheZahl: happy Caturday to you too

PatrickMcGinnisII: :innocent:

MaliciouslyCrypticUsername: I live in CA

MaliciouslyCrypticUsername: So only 9:57 for me :)

Majeck: Can someone explain to me what the winter throne is?

MaliciouslyCrypticUsername: A contest...

MaliciouslyCrypticUsername: :)

Majeck: :)

PatrickMcGinnisII: its ...

**PatrickMcGinnisII is tapping his foot

**Majeck is patiently waiting for an aswer

jrke: its contest just started 30 sec ago

Majeck: *answer

Majeck: jrke really?

PatrickMcGinnisII: so it's COIF

jrke: yes

PatrickMcGinnisII: damn, i was rewriting T7D

PatrickMcGinnisII: t&D

PatrickMcGinnisII: T&D

PatrickMcGinnisII: i voted for coif tho

Majeck: I wanted to do Fantastic Bits

Majeck: So how do I play?

Majeck: Do I just submit my COIF bot again?

PatrickMcGinnisII: it's already there, but yeah w/ improvements

Majeck: Oh

Majeck: That's cool

Majeck: I wanted to get the "get a bot into gold" achievement anyways

jrke: if you have bot improve it

Majeck: And getting to gold in COIF shouldn't be that hard since I'm already in silver

Majeck: Awesome!

PatrickMcGinnisII: my T&D was gonna get better

PatrickMcGinnisII: heh

Majeck: Jeez I wrote 980 lines for the original contest

Majeck: A lot of refactoring is going to happen lol

Majeck: Oh mannnnn

Majeck: I remember that I wrote 3000 lines originally but didn't test it once

Majeck: Stupid past me

Majeck: Well, see y'all tomorrow it's 2 AM where I live :dizzy_face:

Majeck: GL and have fun!

PatrickMcGinnisII: did anyone write an after-contest breakdown?

PatrickMcGinnisII: forum doesn't seem so

eulerscheZahl: for which contest?

jacek: so won

eulerscheZahl: no i won. i wrote there long before you shared the link

jacek: oh?

jacek: i dont read chat

eulerscheZahl: i wrote in the forum

jacek: we have forum?

eulerscheZahl: oh, you didn't share the forum link

eulerscheZahl: i think that's what PatrickMcGinnisII asked for

PatrickMcGinnisII: ahh, cool...tx eulerscheZahl

PatrickMcGinnisII: oh man, this was so long ago, i remeber the "cuts" discussions in chat

eulerscheZahl: was fun

eulerscheZahl: one of my favorite games here

nickarshadi: love

kovi: too bad you missed top3

nickarshadi: love to everyone

eulerscheZahl: i'm no longer suicidal about it :D

kovi: :)

PatrickMcGinnisII: :joy:

PatrickMcGinnisII: it's almost 1:30am my dinner is still on stove, glhf

kovi: at least coif is not that random than some other

eulerscheZahl: i'm curious what they plan for the next contest

MadKnight: anyone playing contest ?

MadKnight: it's CoIF

MadKnight: eulerscheZahl ?

eulerscheZahl: yes, i play the contest

MadKnight: nice

eulerscheZahl: solved the 300 point coding, illedan and squid solved another one each

MadKnight: oh can u send the link to the contest ?

eulerscheZahl: now i try to get into that password protected 7z archive

MadKnight: i lost the link


MadKnight: and i got a random team and i think nobody plays

MadKnight: > R-Boy finds the time machine, which Zer0 used to travel to another era. Nearby, lies a copy of HG Wells’ The Time Machine. Could this book from the past help R-Boy travel in time? Unfortunately, R-Boy can’t read or understand it, because the space-time continuum has changed some of the words. Help R-Boy to start his time travels!

MadKnight: wooow, such a clear description

MadKnight: i have absolutely no idea what i'm supposed to do for this puzzle

eulerscheZahl: coding300 is pretty clear

MadKnight: a picture with a code ?

MadKnight: just random squares

MadKnight: how to get code from these squares ?

eulerscheZahl: sorry, running contest won't tell you

but i'm surprised you don't know yourself

MadKnight: are those just bits ?

MadKnight: i think i'm not gonna participate, i don't have a team of people i know

MadKnight: so u can tell me

MadKnight: >Freed by the guards, R-Boy looks for Zer0 who’s disappeared. He finds Zer0’s notebook and hopes to understand his plans, but his enemy’s writing is in a strange code R-Boy has to decrypt. and then they just give the decryptor - where do i find the message ?

Westicles: So it seems unicode has a bunch of gaps making it useless for encoding. Looks like base65536 is the way to go?

DomiKo: maybe

DomiKo: For me base65536 was wosre than base256

Westicles: hmmm

Westicles: That is what you use?

DomiKo: 40K chars ouput

DomiKo: in base256 is 10K

DomiKo: but in base65536 is 12K :/

eulerscheZahl: :D

DomiKo: some characters must count for 3!

jrke: I like 2048 a lot,Thanks euler :)

eulerscheZahl: :)

dbdr: DomiKo: you hard code in 2048?

DomiKo: yes

eulerscheZahl: if you want to hardcode, the way to go probably is using some heuristic and only save the moves where you do something else

eulerscheZahl: or try to zip it

jrke: hardcoding in this optim i think is not a good idea

DomiKo: I never try so hard to zip the output

DomiKo: so I challanged myself to do my best

eulerscheZahl: just solve it online as you are supposed to do

dbdr: 10K * 30 = 300K

dbdr: that's above the limit

eulerscheZahl: and still too little to get to ille's score

dbdr: yes

jrke: did ille did beam search or made his own search?

eulerscheZahl: i don't know

eulerscheZahl: i only know he doesn't have a constant search depth each turn

eulerscheZahl: and at work they have 1 hour each friday where they can present their personal projects in the team

eulerscheZahl: so he talked about 2048 :D

dbdr: :D

dbdr: so they know

dbdr: inb4 top 10 full of norsemen

eulerscheZahl: time to stalk some Norwegians

Westicles: Hacker euler needs to get that ppt

eulerscheZahl: i'm a bad hacker, failing hard or reply

eulerscheZahl: can't even make the blueberries great again


eulerscheZahl: wait, they aren't even blueberries :D

dbdr: is that the contest?

eulerscheZahl: yes, one of the 25 tasks

dbdr: blackcurrants

dbdr: I think

Jeroo: blackberries (not the phone :) )

dbdr: oh right :facepalm:

jrke: :facepalm:

dbdr: :palmface:

Orpheo: hello ! Does anyone know how the ranking of clash of code is done ? I thought I won one but I'm 6th x)

eulerscheZahl: there are different modes. this one was about code size

eulerscheZahl: you solved the fastest but with a long code

Orpheo: ohh i didn't know

Orpheo: but I guess in java I have 0 chnace in that case :D

eulerscheZahl: you are free to use another language

eulerscheZahl: 15min are enough to look up a few things

Orpheo: yup that's true I just didn't know this type of problem did exist.

Orpheo: thanks!

dbdr: good attitude!

dbdr: oOo

wlesavo: nice dbdr :slight_smile:

dbdr: thanks!

wlesavo: make Illes talk at work worthless :smiley:

dbdr: :)

dbdr: are you still working on it wlesavo?

wlesavo: dbdr also wanted to ask you, are you often reuse approaches that allowed you achieve top scores or is it often small improvements that makes it posiible?

wlesavo: yeah, but not very successful, sim is working, but i feel like neither my eval nor search is god,

dbdr: in optim?

wlesavo: yeah in optim specifically

dbdr: in optim, I reused simulated annealing several times

wlesavo: in 2048 SA worked worse than anythyng for me, i wonder if it is a bug or just a bad implementation

kovi: uh, nice dbdr

dbdr: thx kovi

kovi: sa is still local optima

dbdr: i'm not using sa in 2048

Illedan: :scream:

Illedan: nice dbdr

dbdr: thx Illedan!

dbdr: 55M now

dbdr: 55.6

Illedan: :)

Illedan: Soon 1st then

dbdr: well, probably you're close to optimal

dbdr: I have a single case at 1.3M, probably losing points there

Illedan: What score do you get on testcase 11205586?

dbdr: 2.8M

dbdr: you?

Illedan: From 2.6-2.8 mill depending on it being able to solve the 16k tile at the end or not

dbdr: my solver is deterministic

Illedan: Nice

kovi: wow

Illedan: Not running some ms each round?

dbdr: no

DomiKo: deterministic :scream:

Illedan: Set depth?

dbdr: yes

Illedan: Aha

Illedan: With a little more speed I could do that too

dbdr: everyone else is randomized?

Illedan: What round do you get 5.8 mill on it?

kovi: i use depth, but cant reach it consistently

dbdr: none Illedan

dbdr: misunderstanding?

eulerscheZahl: didn't pay attention for a few minutes :shocked:

dbdr: just #2

Lauwie-Timmer: With ghost in the cell what should a valid action look like?

dbdr: isn't it mentioned in the statement?

wlesavo: so suddenly my aval was based on a single fcking tile

wlesavo: eval

Lauwie-Timmer: I found it nvm

dbdr: what? :D

Illedan: none? :P

dbdr: yeah, that cannot work too well

wlesavo: due to some bug summing of the score was just first tile x 16

Illedan: I mean how many steps do you use

Illedan: to get that max score

Illedan: Wow, you are close

Illedan: :scream:

Illedan: :run:

Illedan: :panic:

dbdr: inb4 wlesavo #1

dbdr: ah, you ment 2.8M, not 5.8M?

dbdr: *meant

Illedan: Yeah, how many frames P:

Illedan: :P

dbdr: 65488 actions

wlesavo: oh, almost twice the score and now im hitting 600 due to poor search optimisation

dbdr: isn't it just that you should send more actions per turn?

dbdr: fear Illedan, fear...

wlesavo: kind of, but now i can search less

wlesavo: well at least it does hit 8r now

wlesavo: 8k

kovi: comps

wlesavo: oh 8mil

kovi: nvm

Illedan: I pray for dbdr to have no more submits :D

DomiKo: ohhh yes finally 32K online

dbdr: Illedan, it's OK, you can relax now

kovi: wow

DomiKo: gg

kovi: grat

dbdr: thx!

DaNinja: noice!

Illedan: :)

Illedan: Good

DomiKo: wow

DomiKo: Ice and Fire are on fire right now

DomiKo: I got promoted to bronze

DomiKo: I guess a lot of submits in wood

wlesavo: dam so it is kind of easy, and i was thinking im stupid

wlesavo: simple mc gives 10mil

dbdr: are you evaluating 2 tiles now? ;)

wlesavo: lol

wlesavo: hitting 32k at least it does play better than i ever could :slight_smile:

kovi: i was unable to reach 10mil with simple mc

DomiKo: 16mln online

DomiKo: ufff

wlesavo: grats dbdr :slight_smile:

dbdr: thx :)

Nerchio: you need to have class Player as main right?

dbdr: yes

eulerscheZahl: always fun when coding bosses with the SDK the offline version expects the code to be a little different than the arena

dbdr: why?

MattSOrme: :

wlesavo: hm almost 15 mil with a raw mc

DomiKo: i just squared some contant and from 6mln to 12mln

geppoz: which game are you talking about?

leojean890: 2048;)

Westicles: DomiKo, I ended up with 8 moves per character. Did you get better than that?

wlesavo: wow nice

dbdr: exactly 8 Westicles?

Westicles: yes

dbdr: what about the holes?

Westicles: holes?

dbdr: not all 16 bit values are valid

dbdr: (09:02:37 AM) Westicles: So it seems unicode has a bunch of gaps making it useless for encoding.

Westicles: oh, I used

dbdr: so that must take the holes into account, and encode slightly less than 16 bits per char

DomiKo: i didn't even get 8 moves per character

Westicles: I'm not sure what it does, but I doubt it is the best out there.

DomiKo: are you sure that it's 8 per character?

DomiKo: isn't CG counting some for more than one?

Westicles: You stuff four moves into one ASCII character, then base65536 gives you another factor of 2

dbdr: not exactly 2

Westicles: 16424 moves to 4106 ASCII to 2053 gibberish

dbdr: in that case. it's possible it's not hitting the special cases

dbdr: the other possibility is, it's generating half the unicode characters, but not all are counted as 1 char by CG


Westicles: Right, half would make sense. A full 32 bit solution would give you 16 moves per character, so there is room for improvement

dbdr: but that's not how CG counts

Westicles: oh, how does it count?

dbdr: also most 32 bit values are not valid unicode code points

dbdr: CG uses Java, and Java uses UTF-16

Westicles: Is there some way to tell CG count?

dbdr: send a text and see if CG rejects it as being over the limit :)

Westicles: Dang, you guys are right. It complains with >64k of these

Westicles: Somebody put in a bug report

dbdr: it's not a bug it's a feature :)

dbdr: gg wlesavo!

wlesavo: thx, still just MC though :slight_smile:

RoboStac: you can past into the ide in any of the code golfs - the character count displayed in that works the same way as the limit

DomiKo: yap

Westicles: good thinking. my 2053 chinese characters counts up to 3202. just terrible

Default avatar.png lala74: hello guys

Default avatar.png lala74: you guys know how to find all my solved challenges ?

dbdr: a lvl2 from japan #2 at Number Shifting :D

Westicles: good, I hope he goes all the way.

wlesavo: lol

eulerscheZahl: "Sorry for my English, I'm not dumb but French" found a funny README on github

DomiKo: I guess Number Shifting is his second puzzle :scream:

eulerscheZahl: after the onboarding

eulerscheZahl: lvl2 doesn't mean you are a noob. just that you didn't play on CG much

DomiKo: yes I know

DomiKo: he just came here to crush us in NS

Shadowtick: hi

Default avatar.png SKIATHITIS: Hello

Shadowtick: how are you?

Default avatar.png SKIATHITIS: very good and you?

Shadowtick: I'm doing fine

Default avatar.png smoked-one: what's with these people just entering a clash and submitting their code with 0 chars just 5 seconds in?

dbdr: that beats anyone else with 0%

Default avatar.png SharpShark:

Default avatar.png SharpShark: Hmm, the pastebin doesn't work, does it...

eulerscheZahl: it usually does. not today

jacek: and yesterday and the day before..

wlesavo: wow, bruteforce depth 6 gives 16.5kk

eulerscheZahl: you still need some scoring to get there

wlesavo: sure but scoring is a simple part

eulerscheZahl: double result = 0;

           result += Grid[0, 0]; result *= 5;
           result += Grid[0, 1]; result *= 5;
           result += Grid[0, 2]; result *= 5;

wlesavo: (when one not scoring based on a single tile)

eulerscheZahl: anything smarter?

wlesavo: sum everything with discount in snake order

eulerscheZahl: i do

wlesavo: oh i see, it is the same

wlesavo: but discount weight matters quite a bit for me

eulerscheZahl: couldn't share more or it would be an expired pastebin

eulerscheZahl: if i go wild on the discount, the lower numbers have no impact at all due to precision

eulerscheZahl: i could use decimal

eulerscheZahl: i use that so rarely that i always half forget it exists

wlesavo: yeah, it should be somewhat balanced

wlesavo: i feel like with depth 7-8 it could be even solved, but my implementation is to poor for that

eulerscheZahl: 5 => 9 is a little better but 96% correct only, timeout

wlesavo: with bruteforce?

eulerscheZahl: beam depth 30

wlesavo: oh i see

PatrickMcGinnisII: beam decisions over one interation depth haven't worked for me, so I been experimenting with 2 ply tree cuts

PatrickMcGinnisII: I gen. depth 5, gen 2 depths for all the nodes with score>=maxscore/4, then over and over 2 ply at a time

wlesavo: if i would skip more options in bruteforce i feel like i could go deeper, but im kindof lazy to implement it, but im really surprised that bruteforce and MC is almost equal with this scoring

PatrickMcGinnisII: i do this til i gen. 20k boards total, can vary between 7 and 12 actually output moves per turn, and it still doesn't produce great results.

PatrickMcGinnisII: my current submit is only a depth 5 full gen., then once with 2-ply, outputting best score w/ a variation of euler's cell modifier

wlesavo: i was stuck at 1.3kk trying different things, until i discovered my scoring is grid(0,0)*16

PatrickMcGinnisII: ok, wow u jumped up to 17M

wlesavo: that jump is basically fixed bug, and some tuning

dbdr: wlesavo what is kk?

wlesavo: 10^6

jacek: and kkk?

dbdr: why not M?

wlesavo: old habbit i guess

wlesavo: jacek :clap:

wlesavo: experimenting in ide is painful

darkhorse64: Trying to catch up on scoring. I am late on the party sorry. Scoring does not take into account game score but rather how tiles are arranged ? This allows for (but not only) a limited depth when searching right ?

Default avatar.png SharpShark: Can someone explain to me why "Unique Prefixes" puzzle, last test case the third correct prefix (out of five) is "verbo"? I just don't understand :-/

wlesavo: darkhorse64 well i think thats what most people do, its kind of natural if you played the game by hand

darkhorse64: Yeah, I spend a few hours *cough* on this game. But when you say it, it suddenly looks obvious

darkhorse64: int64_t instead of double should cure precision problems

eulerscheZahl: my scoring says this is good :thinking:

wlesavo: hm, thats an idea to change scoring

Default avatar.png NevCG: ...

PatrickMcGinnisII: in a paper i read yesterday it said the best place to have the highest number was in the 2nd position

PatrickMcGinnisII: of course that was for completely random play

PatrickMcGinnisII: i didn't try it ... yet


eulerscheZahl: that article prefers the corner for the highest number

eulerscheZahl: seems natural to me as well

PatrickMcGinnisII: omg, yup i read that, sorry brainfart

PatrickMcGinnisII: i guess I meant to keep track of 2nd and 3rd place tiles, to see if it improved

PatrickMcGinnisII: ok i suck

geppoz: I suppose that the fair game is when you don't know how next tile will spawn

geppoz: so you have to evaluate BEFORE the spawn

PatrickMcGinnisII: i took score and modified it score=score<<16+ pos0tile<<8 + pos1tile<<4 + pos2tile<<2 + pos3tile . And it improved 2.4%, but I haven't tried other ways to modify the eval

geppoz: CG varsion is a bit "cheater"

eulerscheZahl: if you don't know the next spawn, you can only print 1 action each time

eulerscheZahl: with a limit of 600 user interactions the board isn't even halfway full at that point

geppoz: y, I understand why CG is in that way

eulerscheZahl: sure, it's a different game. but given the research done on the original i don't think that's bad

jacek: 600 frame limit then why a code of ice and fire can have over 2000?

eulerscheZahl: 600 user interactions, not frames

geppoz: my program doesn't cheat (yet)

jacek: oh

geppoz: next step is to eval with spawn ;)

eulerscheZahl: i could split the single moves into different frames too (had that at first)

eulerscheZahl: but it makes the replay loading more laggy

wlesavo: one possibility would be eulerscheZahl to display only last frames of a turn, but i guess that would ruin many things

geppoz: I didn't meant that it is not nice! :D

eulerscheZahl: that would force some rewrite to make it happen

geppoz: just saying that is different from the ones in the article

PatrickMcGinnisII: wlesavo I think he did, I think he added '-' as a modifier to supress frames

eulerscheZahl: but that - completely disables the viewer

PatrickMcGinnisII: ok, i don't think anyone needs it til u get to maybe 10M, lol

wlesavo: yeah euler, at least animation of mooves would be gone that way, and probably quite a few other things

eulerscheZahl: sure it's possible to only show the final state

eulerscheZahl: but right now the - completely blocks sending any data to the viewer

eulerscheZahl: i would have to send again compute the new state but don't update until the end

eulerscheZahl: some refactoring involved

eulerscheZahl: and it's in javascript :scream:

eulerscheZahl: but feel free to fork and send me a pull request ;)

eulerscheZahl: or figure out why loading the replay takes so much time with viewer and speed it up

eulerscheZahl: that would benefit the whole website

MaliciouslyCrypticUsername: Last 8 messages from euler

eulerscheZahl: 3.5s to load my test match that isn't even that huge

eulerscheZahl: you broke my wall!

eulerscheZahl: hm, each time i call addState, it loops over all the states of taht entity within the frame to see if it's at the same time

eulerscheZahl: linear time for a list. i have a lot of states each frame

Magus: Automaton2000 AutomatonNN

AutomatonNN: go learn coding site for the first time to check if you save their bots

Automaton2000: oh what the hell is that

Magus: :)

eulerscheZahl: oh no, the NN is back :(

PatrickMcGinnisII: AutomatonNN loves eulerscheZahl

AutomatonNN: #MadKnight

wlesavo: lol

eulerscheZahl: even when i completely disable the collision check, it takes almost the same time :(

eulerscheZahl: or maybe my logging is just wrong return directly when entering the function and still most of the time taken there

eulerscheZahl: (╯°□°)╯︵ ┻━┻

PatrickMcGinnisII: I hate the new puzzle Unique Prefixes...i did it, but i hate it

eulerscheZahl: i had a short look, didn't really try

eulerscheZahl: trie haha

PatrickMcGinnisII: Imma go do like work and stuff .. GF coming to see me after funeral for some ... 'consoling', heh

PatrickMcGinnisII: glhf

wlesavo: nice kovi

kovi: thx wlesavo

eulerscheZahl: right in the middle

jacek: only you can put fun in the funeral

jacek: AutomatonNN is it fun?

AutomatonNN: when it was in the browser contest to the next contest

Shadowtick: hello

Majeck: Hello

Majeck: Is there any way for variables to be uppercase from the stub generator input?

Majeck: Oh never mind

Majeck: It was just in python that the stub showed it in lowercase lol

Default avatar.png riiiandeadsea: What does this error mean? ERROR: object '' from LD_PRELOAD cannot be preloaded: ignored.

MSmits: it CG side bug

MSmits: dont worry about it

Default avatar.png cakeman38: hello

Majeck: hi

Majeck: Hi

Majeck: I just finished the Network Cabling puzzle and I was wondering if someone could explain to me why the solution works

LastRick: I can try

Majeck: I mean I solved it because I saw "Median" in the tags so I thought of using that as the main_cable_y but although it works I don't understand WHY it works

Majeck: Thanks LastRick


LastRick: Did you ever draw the layout of the puzzle, say on paper?

Majeck: Yep

Majeck: And I realized that the median was always the one with the lowest cable length

LastRick: yep

Majeck: But I don't understand why hahaha

LastRick: is there a pattern to the rest of the Y-locations?

Majeck: If you mean the house positions I think they're all random

Majeck: Ohhhhh do you mean a pattern in the length of the cable when you alter main_cable_y?

LastRick: Yeah, without giving away too much here in public, basically there is a relationship between pairs of Ys that becomes apparent if you sort the y distances (relative to the median)

Default avatar.png SharpShark: Anyone did ? I just don't understand how the last testcase is correct -

magaiti: looks correct to me

Default avatar.png SharpShark: I read this "* Each given word must have a distinctive prefix from the prefixes of the other given words." as "all the output prefixes must be different"

magaiti: well

magaiti: anything written about duplicate words?

Default avatar.png SharpShark: Sure, I just think those two sentences kinda contradict each other ("* A prefix cannot be used by two different words.")

magaiti: well i guess you have to assume duplicate words count as one for "each given" part

Default avatar.png SharpShark: And the next point is so weirdly written that it kinda leaves room for interpretation.

Default avatar.png SharpShark: I think I understand it now, but only after looking at the test cases. Which is weird, I believe the description should be all that is needed.

magaiti: "That should look familiar for those who handled switches for their command-line scripts or maintained their completion tables. "

LastRick: Yeah I completely ignored that line in the description

magaiti: with this in mind, it seems logical to assume duplicate works should have the same prefix

magaiti: words*

LastRick: I solved it the same way SharpShark did, by focusing on the solutions.

Default avatar.png SharpShark: If you have to assume (especially based on something that doesn't even look like related to the actual description of the problem) then I think the description is just wrong.

magaiti: whatever, that's how real problems are formulated any way

magaiti: real world problems

LastRick: Agree to disagree. It could have been written better.

magaiti: yeah it could have

magaiti: but it's your job to find out

LastRick: Find out what?

magaiti: everything you have to know in order to solve the problem

LastRick: Disagree. That's the submitter obligation (unless it's a reverse).

Majeck: SharpShark

Majeck: Nevermind

Majeck: My computer lagged

magaiti: well you see. in real world you dont have submitters. you have customers. they will do their best to describe their problem, but you can't expect a perfect description

Majeck: But on the topic of descriptions vs solutions I have a pretty strong answer

Majeck: I agree with magaiti for the most part

Majeck: In a perfect world the description would be all that is needed but we most definitely don't live in a perfect world

Majeck: For example every time I work on a school related test almost half of the work is deciphering what I'm being asked for

Majeck: Typos, the professor getting confused, black and white images, etc

Default avatar.png SharpShark: I take this site as "from devs to public (devs)" and not "from public to devs". If devs won't show the public how it's done, it's never gonna improve and devs gonna keep complaining about incomplete inputs etc.

Majeck: For codingame I think this applies even more, usually unless it's one of the "main" puzzles, I mainly focus on the test cases instead of the description, for more than once have I found errors in it

Default avatar.png SharpShark: Plus this site is for fun (to my best knowledge), you would get paid for deciphering the inputs in the real world.

LastRick: I'm with Sharp. I'm a developer, I am gonna to define the problem as perfectly as possible (not like a customer) and I expect submission to be held this high of standard.

Majeck: SharpShark getting payed for something MOST DEFINITELY DOES NOT follow what you're being paid to do being of quality

Majeck: Ahh weird grammar

chinaredclif: someone is good in c

chinaredclif: can help in my problem

magaiti: part of this site is meant to find employment

magaiti: sponsored contests, that "jobs" button i never touched

Majeck: hahaha

Majeck: Once I passed level 15 I got scared af by the pop-up telling me I could work at Google

Majeck: Or employees if you press the notification at the top that everyone's brain has filtered

LastRick: hahah

Majeck: (I didn't realize it was there till I looked for it lol)

chinaredclif: who can tell me what is the method

Majeck: Anyways I think that in a perfect world the statement/description should be all that is necessary to solve a puzzle

Majeck: And I see no problem in anyone refusing a puzzle because the statement isn't clear enough

Majeck: However we can't control the past

chinaredclif: I want to store in memory my variable during my tons of input

Majeck: And in the past a lot of puzzles have been passed with incomplete/confusing statements

magaiti: if your goal is recreatoin, do what you want, no argument here

Majeck: And though it sounds harsh you usually win nothing by complaining about how things should be

Majeck: Like what I do is if it really bothers me I go and fix it

Majeck: Or bother a codingame mod till he fixes it for me lol

Default avatar.png SharpShark: I would fix it, I just don't think my level is high enough.

Majeck: Man

Majeck: I miss discussions

LastRick: Yeah, I think you have to be Level 29 to touch the puzzles. It's pretty high

Majeck: Like my monkey brain tells me that we've all been in a round table talking but in reality I'm just as lonely as ever lol

LastRick: To put that in perspective, I've solved every Easy, half the mediums and some of the remaining hard. Only level 24. I can't even look up a validator.

Majeck: LastRick yep, you can edit clashes after playing 300+ though

Majeck: Have you solved any very hard puzzles?

LastRick: Majeck, you're right, it's been a great discussion. I really enjoy this site.

LastRick: Nope, haven't gotten to those yet

Majeck: Woah LastRick you only joined in August

Majeck: And you've already finished all those puzzles?

Majeck: Are you sure you're not a robot programmed by Euler or MSmits?

Default avatar.png SharpShark: By the way, one more note - I played with the Mars Rover 2 (medium) yesterday and I think the second test case has inputs in the wrong order Y_Y

Default avatar.png SharpShark: (or whatever is that landing thing called)

magaiti: landing thing is called mars lander, duh

Majeck: Pretty sure Mars Lander - Episode 2 is A-Okay

Default avatar.png SharpShark: I think I was getting negative inputs for X and Y and such

Majeck: I think you got the negative inputs for velocity

Majeck: "hSpeed and vSpeed are the horizontal and vertical speed of Mars Lander (in m/s). These can be negative depending on the direction of Mars Lander."

Default avatar.png SharpShark: Yeah, that is correct. I was getting it for X and Y though :)

Majeck: Maybe you forgot to read an input and it de-phased?

Majeck: It's happened to me before

Default avatar.png SharpShark: I passed case 1 and I needed to shuffle the order of inputs to start getting reasonable values in case 2

Majeck: Ohhhhhh

Majeck: That's a big nono

Majeck: Don't mess with the predetermined input stub

Majeck: lol

Default avatar.png SharpShark: Exactly

Default avatar.png SharpShark: That's why I'm saying it looks broken :)

Majeck: You can press the refresh on the top right to get the stub back

magaiti: you lose everything else tho

Majeck: Copy your code -> hit refresh -> paste your code

Majeck: And then delete the input handling of your old code

Default avatar.png SharpShark: I mean if you finished that one you can just go there and hit "Play all testcases" again to see whether it's all gonna pass or not, right? If I'm wrong then all is gonna pass. If I'm right then your old code "won't work" anymore because of the inputs.

Majeck: They all passed

Majeck: However I did use the optimization puzzle cause I refactored it not too long ago

Majeck: And I have printerrs saying the position and stuff

Majeck: I'll test in on the original puzzle

Default avatar.png SharpShark: Maybe someone fixed it already since yesterday :) Gonna take a look again, maybe tomorrow.

Majeck: They also work on the original puzzle

Majeck: I think the odds are higher that you messed up rather than the code did

Majeck: Not trying to be mean

Default avatar.png SharpShark: Definitely, as I said, gonna take a look again later.

Majeck: It's just that from experience the amount of times I've blamed the code/computer/system for something vs it actually being me is pretty close to 100% hahaha

Majeck: The only time I was genuinely wtfed by the compiler was once that an int was passed by reference in C#

Majeck: It was the one and only bug I've faced by a compiler, but then I closed it and opened it again and it worked as intended

Default avatar.png SharpShark: OK, last question (since I just tried it and it still seems weird on my end) - can it be that it's broken only for some languages? Meaning are the test cases written separately for each language (usually in that given language)? Or are they written only once (in bash or whatever)?

magaiti: input stub is written in a pseudocode

magaiti: sometimes it gets translated wierdly

magaiti: which language you are using?

Default avatar.png SharpShark: Java

magaiti: hmm, its rather popular language

magaiti: there should not be problems with input stubs there

tibu: Hello, i got some trouble with promise in js


magaiti: try rewriting your code, like reading a whole line, and then parsing it

tibu: Can someone help me how to return correctly count variable

tibu: I sent a link with the code, you can have look

Majeck: SharpShark I'd recommend just copying your code, hitting refresh and then pasting it and deleting the input handling

Majeck: I think you missed a sout or a in.nextInt()

Default avatar.png SharpShark: If I have this as my game loop the first test case returns correct debug output, second returns incorrect debug output (Y below 0).

Majeck: tibu you can copy/paste code and it will automagically generate a pastebin link

Default avatar.png SharpShark: The second test case also says the "Warning: your code did not read all available input before printing an instruction..." which I have no idea how can happen if the first case passed without the warning.


tibu: i got confused why this function not return count correctly

Default avatar.png SharpShark: (One correction, the Y isn't below 0, it's always 0 in the example I provided, which is wrong as well.)

Majeck: SharpShark

Majeck: My theory was correct

Majeck: "Warning: your code did not read all available input before printing an instruction..."

Majeck: Means you printed a sout before reading all or didn't print a sout at all

Majeck: I'll check your code

Default avatar.png SharpShark: I know what it means, but how come case 1 doesn't print that? :)

Default avatar.png SharpShark: Please, check the code, it's fairly simple as it doesn't do anything :D

magaiti: input: 7 numbers, output: 2 numbers

magaiti: some languages need extra effort to handle newlines

Majeck: magaiti's totally right

Majeck: Once in Java I remembered I did like 10 lines just to handle those screwy newlines from user input

Default avatar.png SharpShark: Still doesn't answer why case 1 works and case 2 doesn't with the same code.

magaiti: because in case 1 the input alignment is corrent, and for case 2 is not

Majeck: Ok SharpShark I tested it

Majeck: I know what you did wrong lol

Default avatar.png SharpShark: What do you mean by input alignment? Example?

magaiti: example you are given 7 numbers per turn, and you read 6 or 8

Majeck: There's a secret console to where codingame writes

Majeck: And if you read 6 inputs and codingame writes 7 you'll get out of sync

Majeck: In any case SharpShark rotate and power are supposed to be read last


Majeck: That should work

Default avatar.png SharpShark: Sorry boys, I think I found it :) (And it was outside the game loop, so it wasn't in the excerpt I sent.) Premature optimization gone wrong :) (I didn't read the whole landscape since I already found a landing site, so I breaked out.) My bad!

magaiti: yeah i was thinking about that

magaiti: dont optimize input

Majeck: but but

Majeck: What I said is also valid

Majeck: Your excerpt was reading rotate and power instead of X and Y

Default avatar.png SharpShark: It is, but wasn't the root cause of the issue (I was playing with the order because I was getting weird numbers, so I knew that I played with that, but the actual issue that lead to me playing with the input order was before the excerpt).

Default avatar.png SharpShark: And that's why I thought the cases might be wrong - because the inputs "were fine" for case 1, but not for case 2.

magaiti: just because something passes doesnt mean its correct

magaiti: garbage in - gabage out

Default avatar.png SharpShark: You are correct, harder to validate though in this specific environment :)

Default avatar.png SharpShark: I'll know better next time though :)