From CG community
Jump to navigation Jump to search

Default avatar.png kokuou: no, you'll automatically get credit once the round is over

Putnam3145: so the answer is "yes", but it takes no effort on your part

Default avatar.png FAKE:

Default avatar.png FAKE: Nevermind, I see that the console output is kinda weird and puts the message for the next round in current round span...

Default avatar.png idonthaveidea: hi]

Default avatar.png idonthaveidea: hi*

Default avatar.png idonthaveidea:

Default avatar.png xphoenixd: lmao

Default avatar.png xphoenixd: 2 seconds ://

Nghia64582: how the fuck

MSmits: stored solution

MSmits: if you do hundreds of clashes you see repeats

eulerscheZahl: i don't see anything suspicious about solving a clash in 2min 35s

MSmits: oh I saw 2 seconds, did not click

MSmits: thought they solved it in 2 seconds :P

Default avatar.png maybesmurf: lol

Default avatar.png Memo12334: hacks?

Lauwie-Timmer: Im a bit confused can anyone pass me a Legends of Code & Magic sample script

MSmits: are there starter bots for it?

Lauwie-Timmer: idk

MSmits: you should probably ask a more specific question

MSmits: about what you're confused about

Lauwie-Timmer: How I get my cards and the opponents cards

MSmits: you dont get your opponent cards I think, just how many he has. And of course whats on the table

eulerscheZahl: there it is

MSmits: did you write a bot for a game before Lauwie-Timmer?

MSmits: cuz locam is a bad place to start

MSmits: it is complicated, both the input and the game itself

MSmits: unless of course you're a good coder and just haven't done bots before. Then you could figure it out probably

Lauwie-Timmer: Oh, yes im pretty new to codingame in general

Lauwie-Timmer: I did a couple easy puzzles at first

MSmits: ah ok

MSmits: bots are a big investment. Can take a few hrs to even get a basic bot going in some cases

Lauwie-Timmer: Ive only made cryptocurrencty tradingbots but not bots for games

MSmits: cool

MSmits: well if locam motivates you to keep going it's ok I guess

MSmits: I'm just saying there are easier games

Lauwie-Timmer: Where do you suggest i start

aCat: hi - yep LOCM is a bad place to start ;]

MSmits: hmm the website tells you to do coders strike back basically

MSmits: but there are other options

Default avatar.png Memo12334: but can you solve Lumen

Lauwie-Timmer: I dont know

MSmits: if you like board games, just about all of them are easier than locam. Getting a bot working there is easy, but you need a search algorithm for the bot to be any good

Lauwie-Timmer: Okay Ill check out another game first

eulerscheZahl: this one starts with a classic 3x3 tic tac toe

MSmits: that's true for most simple bot games. The simpler the game, the more likely that you need a robust search algorithm

aCat: there are some nice not too hardcore things to do like tron, codebusters, fantastic bits

MSmits: yeah UTTT is great to start with also

Default avatar.png Memo12334: do u guys recommend to do all easy puzzles first?

aCat: when you don't need a very proper algorithh to do nicely

MSmits: Memo12334 definitely not all

aCat: UTTT also

Default avatar.png Memo12334: one should be able to do easy puzzle in ~10 minutes?

Default avatar.png Memo12334: before going to more advanced stuff

MSmits: Memo12334 I am not able to do that most of the time :P

**eulerscheZahl hasn't done all easy one and probably won't do

Default avatar.png Memo12334: oh lol, good to hear ngl

Default avatar.png Memo12334: eulerscheZahl why?

eulerscheZahl: some are boring

MSmits: I'm mediocre speed. Many strong players can do them below 10 mins though, including euler

Default avatar.png Memo12334: crazy abstract thinking

MSmits: I sometimes can do 10 min, usually 15-20 for easy

Default avatar.png Memo12334: ok if I have done 20 easy then im going to medium

MSmits: also Memo12334, difficulties arent set in stone. They are very relative

MSmits: you may find some medium ones really easy

MSmits: on the other hand, i think marslander 2 is medium, unless they changed that

eulerscheZahl: you may even want to have a look at the hard ones. and step back to medium if you struggle with hard

MSmits: it's really *not* medium

Default avatar.png Memo12334: I struggle even with easy ones :S

Default avatar.png Memo12334: did like 15 or something now but still struggle everytime I begin a new easy challenge

MSmits: ahh keep going a bit then

eulerscheZahl: mars lander depends on how you approach it: you can pass with a few simple if-else statements or you can write a search. the latter isn't easy and the first isn't a generic solution but just passing the given testcases

MSmits: sometimes they require specific domain knowledge that can make them hard for you

MSmits: eulerscheZahl i did it with heuristics and had great trouble with it

MSmits: they are hit and miss, guess i didnt find the right ones

Default avatar.png Memo12334: when one is rdy to do the clash of code that's about bots, genetic algos etc

eulerscheZahl: i tried a search and failed. then solved it with heuristics in about 20min

MSmits: Memo12334 are you asking when you can do multis?

eulerscheZahl: after solving all hard ones and most very hard ones before

MSmits: ahh ok

Default avatar.png Memo12334: ye I just saw this clash of code thing on the main page thats about bots and it got my interest. It goes from bronz to legend. Is that multi

MSmits: hmm i think you are confused

MSmits: clash of code is something else

MSmits: that's basically puzzles that are easier than easy

MSmits: but you solve them competitively

MSmits: speed etc.

MSmits: multiplayer arena's are the bot games

MSmits: totally different world

Default avatar.png Memo12334: oh it was this

MSmits: yes thats one of the many bot games

MSmits: whether or not you're ready for that is kind of hard to say

Default avatar.png Memo12334: awesome stuff

MSmits: if you want to rank high, then you're not. If you just like to get a bot going and get out of the lower leagues, then you're ok

MSmits: some bot games are hard to get going in, like legends of code and magic, that we just discussed

eulerscheZahl: just give it a try. you can also check out the other games and watch a few replays to see what looks interesting (and easy enough) to you


eulerscheZahl: that's the link i wanted to share

Default avatar.png Memo12334: yes but tbh I want to get good in easy challenges first.

MSmits: sounds good. It's what I did

MSmits: but don't be afraid to fail against other players. You don't need to be great to compete

MSmits: it doesn't take that much to beat half the players on the board really

MSmits: most of submitted bots are simple bots and a few if-else rules might get you halfway up the ladder in some of those games

MSmits: a few days ago I tried the board game breakthrough and a bot doing random moves got rank 129 out of 163

MSmits: (not suggesting this game for beginners though)

Default avatar.png Memo12334: yes but u have maths background tho

MSmits: that helps in some cases and it useless in others

MSmits: for example, you can do the game code a la mode, that's about cooking food

MSmits: math won't help there

MSmits: also, often you can steal the math required for simulation of the game from the game referee (the source code)

Default avatar.png Memo12334: where is that

Default avatar.png Memo12334: github?

MSmits: it's linked from the description of the game usually, yeah github

Default avatar.png Memo12334: oh

MSmits: sometimes it's complicated though, i would not go into the math of coders strike back

Default avatar.png Memo12334: im trying to get good in easy medium challenge first for sure

MSmits: it's really extensive. Most of these physics games have some math that'll scare you if you dont have any background in it

MSmits: but most games aren't physics games

Default avatar.png Memo12334: good to know because I am more motivated to through my maths book now

Default avatar.png Memo12334: go*

MSmits: Memo12334 the easy puzzles that will help you most are the ones that force you to learn search algorithms

MSmits: or maybe those are medium mostly

MSmits: pathfinding and such

Default avatar.png Memo12334: oh I will look for those after I completed Lumen

MSmits: is lumen the one where you need to output which squares are lit?

Default avatar.png Memo12334: not lit

MSmits: ah ok

MSmits: I think i did that one

Default avatar.png Memo12334: the places which givee zero light

MSmits: when practicing python

Default avatar.png Memo12334: I don't need to do something with recursion right?

MSmits: recursion is rarely *needed* though sometimes it's useful, for sure not here though

MSmits: i'll see what i did

Default avatar.png Memo12334:

Default avatar.png Memo12334: got only this till now :S

MSmits: i did a 4 loop

MSmits: 4 loops inside eachother

MSmits: 2 loops to loop over all cells

Default avatar.png Memo12334: ye that's what I got now

MSmits: then for each cell, another 2 loops over all cells so i can see if a lamp is close enough

MSmits: if not, then it's one of the zero light cells

doompack: i dont understand

MSmits: my solution is not very efficient

MSmits: but works

MSmits: doompack understand what?

Default avatar.png BlackWraith: Anyone know the difference between encode and decode for the Enigma Machine puzzle? Encode is fine, struggling with Decode.

Default avatar.png Memo12334: yes

Default avatar.png Memo12334: decode is just reverse of encode

Default avatar.png Memo12334: so rotor 3 to 1 and then deceasar

Default avatar.png BlackWraith: Thanks.

Putnam3145: dang i'm not seeing any other solutions for the weekly

Putnam3145: guess i'll have to check later??

jacek: ohai

eulerscheZahl: moin

MSmits: hi

MSmits: hey jacek, I am still trying to get the race patterns to work. Never got access to the paper i found on this, but I figured out something. It still has bugs though

MSmits: there is one paper that you can access but it doesn't explain much

MSmits: you need to request access for the other paper I found, but they didnt give me :(

MSmits: here's an example. Solves pretty soon, but incorrectly identifies some patterns as winning I think

jacek: well i have something too, at the very least its easy to solve 1-2 plies before the end

MSmits: yeah, I had that without patterns

MSmits: 4-5 plies at best

Mutant17: hello

MSmits: unless there are almost no pieces, then i could get 10 or so

jacek: its quite hard to search for paper for breakthrough

MSmits: yeah

jacek: all you get is about the ai breakthrough or something

MSmits: yeah or a breakthrough in medicine or something :p

darkhorse64: you can find the "Programming Breakthrough" article on google books. It's incomplete but you get the original evaluation function.

MSmits: ohh

MSmits: thats the one i requested!

MSmits: thanks darkhorse64

MSmits: is the function any good?

darkhorse64: It has 4 features: piece count, piece value, piece safety, breakthough capability (how many friends or empty squares in a 2x3 rectangle in front of the piece). I did not implement that one (paper looks unclear to me)

darkhorse64: I read you have mobility (similar to the 2x3 rectangle ?) and empty columns

darkhorse64: and piece count

jacek: piece safety is quite important. undefended attacked piece is a no-no

jacek: and of course piece-square table

MSmits: i dont have that yet

MSmits: basically I have most things except attack/defend feature

MSmits: and all my parameters are unfitted

jacek: have you seen checkers link yesterday?

MSmits: nope



MSmits: row max and power basically means 2k points for 7th row (almost win) and quadratic reduction for earlier rows

MSmits: it fills an array i use for lookups

darkhorse64: empty what ?

MSmits: nice one jacek, may help me figure out a way to tune params

MSmits: empty columns

MSmits: not sure if that's a good feature

MSmits: but it's in for now


MSmits: I used this to draw features from

MSmits: its obviously horribly inefficiently implemented there, with loops over pieces instead of bit operations, but the ideas arent bad and got me to rank 14, even without fitting params

MSmits: generally I tend to pick my params fairly well at first try though

MSmits: though my piece count value is probably too high

MSmits: and some of the others too low

MSmits: the reason i dont have an attack/defend piece thingy yet is because that link implements it very weirdly

darkhorse64: I remember this one. I have seen your performance figures. You have at least a 2x advantage over my bot. I need to at least backport a few improvements I did on my latest MCTS. My piece count bonus is within the range of my piece squre value

MSmits: same with me i suppose

MSmits: max = 2k for square value

MSmits: i dont do anything magic to get this kind of performance though. The last few games, all I did was find all the features I can think of, slap a param on them and start fitting

darkhorse64: my range is [2-36]

MSmits: mine goes 2k -1k-500-225 etc. starting from 7th row back

MSmits: possibility quadratic is not the best power to use here

MSmits: thats why i gave it a parameter to fit later

jacek: and home row?

Lauwie-Timmer: With tic-tac toe how do I know what field im in

Lauwie-Timmer: when theres 9 fields

MSmits: not sure, very low jacek

MSmits: it's rounded to integers

MSmits: floored i guess

jacek: Lauwie-Timmer depends on last move

jacek: MSmits huh, home row is important

darkhorse64: Home have highest value than middle row

MSmits: really

MSmits: let me add that to my list then :)

Lauwie-Timmer: What do you mean with depends on last move

MSmits: when the opponent plays top right corner, you play top right board next

MSmits: you decide where your opponent goes

MSmits: watch a few replays

jacek: if last move on small board was top right, then you play in top right board

MSmits: from leaderboard

darkhorse64: My values are lifted from the Porgramming Breakthrough paper. I guess my move gen is bad. I have three int64 for left, right, forward, did not find a better idea

darkhorse64: 5, 15, 15, 5, 5, 15, 15, 5,

MSmits: i have the same movegen

darkhorse64: home row first

MSmits: inline uint64_t DiagonalLeftMoves(uint64_t board) { return board & DIAG_LEFT & ~(board >> 7); }

MSmits: DIAG_LEFT is a mask so as not to go off the board on the side

MSmits: i dont bother having a row evaluation for the last row because it's a solved state

MSmits: no need to ever evaluate it

MSmits: hmm lookups will be slower this way, if you have to loop over all pieces

MSmits: I have it this way for onitama

MSmits: but there are very few pieces

darkhorse64: Looking back at my 9 months old code, I think what sucks is that I build a move [start,end] array from these ints. No alloc there, but still many writes

MSmits: ah yes


MSmits: I always do it that way

MSmits: not sure if it is the fastest way

darkhorse64: It saves writes at least. It's the drawback of reusing code. I tend to write the engine according to the MCTS interface. In this case, altering the interface is better. I have also a different code path for B & W

MSmits: ah yeah thats something i was struggling with

MSmits: I have 1 codepath, but I had to keep both playerboards from their own perspective, their homerows being the smallest indices

darkhorse64: I gave up early

MSmits: so everytime i do a movegeneration I reverse the bits of the opposing player

MSmits: well you already won because you're the creator.

MSmits: kudos

darkhorse64: There's an intrinsic for that ?

MSmits: no there's not unfortunately


MSmits: but you do it once per movegen, you're generating some 20 moves and only have to do this once

eulerscheZahl: that code looks familiar

Astrobytes: ;)

MSmits: yeah i distilled it off that page you guys shared

darkhorse64: I am not the game designer. Even though I am a Java noob, it was not too difficult

MSmits: it was spread out over severall .h files

eulerscheZahl: he also tried to find the minimum number of operations needed for different lengths

eulerscheZahl: for 3 bits you can keep the middle one

Scarfield: why are numbers given as hex and not int, saw that in othello bots as well?

MSmits: yeah thats why it was spread out

MSmits: hex is easier, you can imagine a single hex as 4 bits

MSmits: I know F = 1111

MSmits: i often use decimal for smaller ones though

eulerscheZahl: in Java you can do 0b1111 instead of 0xF

MSmits: you can do it in most languages

darkhorse64: In C++, too

eulerscheZahl: in C# too since recently

eulerscheZahl: wait, C++ has that? how could I miss it?

MSmits: I used it in c++ i think in ooc

jacek: c++14 or better

darkhorse64: Yavalath needs many, many masks. Binary representation helps

jacek: i use 0b for uttt

MSmits: Scarfield look for example at this one:

MSmits: uint64_t DIAG_LEFT = 0x00FEFEFEFEFEFEFE;

MSmits: FE = one row

MSmits: FF is a full row

MSmits: FE is 1 less on the rightmost bit

Scarfield: ooh yea thats neat

Scarfield: ty

MSmits: np

darkhorse64: CG delivers bitboarding MS

MSmits: MS?

Astrobytes: Scarfield, you can visualise that kind of stuff here:

MSmits: well that would have been nice when i just started out with those :)

Astrobytes: (no https unfortunately)

MSmits: now I see those in my dreams :P

darkhorse64: Master of Science

Astrobytes: hehehe

Astrobytes: MSc

MSmits: oh right

Default avatar.png Don.Paul: Hi guys

MSmits: yeah if you do a lot of board games you get really good at it

MSmits: and sometimes it helps for contests

Scarfield: haha of course thats a thing, ty chessstroBytes

Default avatar.png Don.Paul: Can I access past problem's statement from clash of code?

Astrobytes: no worries Bitfield

MSmits: does it even show you the name of the problem?

Default avatar.png Don.Paul: I guess not ;(

MSmits: i couldnt find a way to do it, aside from finding the contributions if you are high enough level

MSmits: it's to stop you from hardcoding too easily i guess

MSmits: i mean storing earlier clashes

Default avatar.png Don.Paul: ah, right

MSmits: you can still do it

MSmits: it's just more work

Default avatar.png Don.Paul: ok, thank you!

MSmits: but if you do so many clashes that you're seeing repeats, maybe you should look for funner things to do on CG:)

Default avatar.png Don.Paul: I was trying to find some exercises to use strings

Default avatar.png Don.Paul: I want to show my friends something about string.

MSmits: ahh plenty of those in the easy puzzle section

MSmits: maybe do the ascii puzzle?

MSmits: not sure if that one is suitable for your purposes but it's a string puzzle

Default avatar.png Don.Paul: I can't playing

Default avatar.png Don.Paul: play it*


jacek: hm?

Default avatar.png Don.Paul: Omg, but there wasn't any solve button till now.

MSmits: I do magic

Default avatar.png Don.Paul: Thank's!

MSmits: np

Default avatar.png DeathBringer666: If I'm not 1st I'll hack every one of you

Default avatar.png DeathBringer666: I know your IP source code

jacek: if youre not 1st, will you delete account

Default avatar.png DeathBringer666: ofc

Astrobytes: Bring it on

Default avatar.png JBM: "IP source code" that's a nice one ^^

Default avatar.png JBM: i'm stealing it

Astrobytes: Surely deliberate. No one is that foolish.

Default avatar.png JBM: ofc

Astrobytes: brb, downloading more RAM

Default avatar.png JBM: RAM? i wanna download wine

Default avatar.png JBM: with the usb faucet

CptComplex: i have a question: can i use the unity engine here?

Default avatar.png JBM: not really

MSmits: I used it :P

CptComplex: so i have to code all this vecor bullshit myself?

MSmits: I used it to create a program off line to hard code zombies validators :P

MSmits: but generally no, unity is useless

Default avatar.png JBM: you can copy-paste it

MSmits: CptComplex you dont need vectors much except for some physics games

CptComplex: i know

Astrobytes: "Vector bullshit"

CptComplex: haha sorry

Astrobytes: :grin:

CptComplex: i want to do the coders strike back challenge

MSmits: yeah thats one of the few places where it can be helpful

CptComplex: so i need vectors

MSmits: people have shared code for it though

Default avatar.png JBM: just use complex numbers

MSmits: check the links on the csb page

CptComplex: hahaha

Default avatar.png JBM: every language has it

jacek: sqrt(-1)?

CptComplex: oh o thought it would be a joke with my name

Default avatar.png JBM: now you're dreaming

Default avatar.png JBM: nope, not awake enough for that

CptComplex: nah i already coded the basic vector stuff a year ago but it would be nice to have the basic funktions

CptComplex: thank you

CptComplex: i will use some shared code and do the rest myself

inoryy: it is a fitting name if you're asking for the whole unity engine to do very basic vector calculations

Astrobytes: :D

MSmits: are there languages with vecotr stuff in their basic libraries?

inoryy: that's like asking for a death star to kill a bug

Default avatar.png JBM: "hey it works"

MSmits: some bugs need the death star imho

Astrobytes: hahaha well put

CptComplex: i mean.. i would also settle with a small vector library

Astrobytes: Write yourself one, won't take long and you can reuse it

CptComplex: but i think importing is not possible at all

MSmits: you cant have different files here

MSmits: everything goes in 1 file

MSmits: so you cant add your own library

Astrobytes: just copy-paste what you need

AlwaysBeDream: hello guys , can you give me any suggestion website which provides payment gateway service.

Default avatar.png Memo12334: still doing Lumen

Default avatar.png Memo12334: *cries*

MSmits: jacek I got it to work finally


MSmits: race patterns

MSmits: bot still plays pretty poorly due to bad eval, but at least it solves about 10 plies before the end :)

MSmits: went from rank 14 to 11, about 2 rating

Laminator: whoa, so many cool games out there lol

MSmits: yeah too many :)

Drihnking: hi

Chen: submitted a new version of my bot but it's performing a lot worse

Chen: feelsbadman

MSmits: which game?

Chen: ye ol' tron

MSmits: ahh

MSmits: I havent gotten to legend in that one

Chen: my old paranoid bot from 2 years ago got to 23rd in legend

Chen: i had a lot of new ideas that i thought would work better

Chen: but it seems not

MSmits: ah nice rank

Chen: ty :D

Chen: i should probably do some other games at some point

MSmits: yeah

jacek: mhm

MSmits: sup jacek?

jacek: nice, about race patterns

MSmits: I can give you a quick explanation without getting into coding details if you want?

jacek: i have some 'patterns' as well but probably less robust

MSmits: we might not be talking about the same thing

MSmits: patterns is kind of general

MSmits: your ntuples in othello are patterns too

jacek: well not patterns, but more like ifs

MSmits: ah

jacek: so pawn can go through the defense holes

MSmits: I do stuff with pext and pdep to extract triangles in front of the piece i just moved

MSmits: if you only take the piece of the board that can affect your pawn, you can use a lookup array to see if it can be blocked

MSmits: if you do it when the pawn enters the opponent board (row 4), it is at most 15 cells

MSmits: so 15 bit

MSmits: I only use this array if this pawn is closer to the end than any of the opponent pawns because otherwise he would win the race

MSmits: or *may*

MSmits: this is not exactly what the paper was talking about, because my racing patters only work for 1 player pawn vs all opponent pawns in front of it. It does not allow for player pawns working together

MSmits: (though they are allowed to be in the triangle, it just doesnt count as help)

MSmits: but the paper pretty much failed to generalize their method, so who knows, maybe this is as much as you can do with in CG constraints

AntiSquid: which paper?

MSmits: Solving breakthrough with Race Patterns and Job-Level Proof Number Search

AntiSquid: ok cheers

AntiSquid: found free legal link: google only sent me to paid links lol is this full version 12 pages?

MSmits: I think so

MSmits: there is a different paper called programming breakthrough

MSmits: wait no not that one

MSmits: there is another one about racing patterns, but its not public

AntiSquid: then i am lost because the one i linked is closest in title ...

MSmits: yeah

jacek: i think this is the paper no?

MSmits: lemme check if i could find it

MSmits: cant find it now, but I am sure it wasnt just that one paper.

MSmits: i requested it on researchgate, but i cant find pending requests

MSmits: Using Partial Tablebases in Breakthrough

MSmits: found it

jacek: thats for 6x6?

MSmits: doesnt matter

MSmits: it's the concept i was interested in

MSmits: end game tables

AntiSquid: browsing history ... filter by research gate

jacek: i bet they just build the upper 3x6 or 4x6 rectangle

MSmits: probably, but for racing patterns you only need to worry about a wedge shape pattern in front of a pawn, so it's doable on any size

MSmits: that is if i am not using the concept wrong, it's my own interpretation. They dont explain it all that well

jacek: like mcts solver eh

MSmits: well the mcts solver paper is explained fairly well, but it doesnt work for draws and the pseudocode is :poop:

jacek: good theres no draws in bt

MSmits: for bt it should be fine yeah

MSmits: bah I added more features and now my bot is worse

MSmits: hmm it seems bad when your bot chooses to advance one pawn all the way to the opponent board only to trade it

MSmits: you waste many turns that way when the opponent only loses a pawn that hasnt advanced much

MSmits: I guess I am valueing advancement too much

jacek: if its not supported by anyone, its worthless

MSmits: yeah

Andriamanitra: the fuck is going on with the test cases of this puzzle

Allis: How do you mean?

Andriamanitra: try in ide

Allis: Oh, wow.

jacek: no stub?

Andriamanitra: i guess it's all kinds of broken

Default avatar.png Rosener: lol that's weird, I just did what I thought was that one in CoC and it worked fine in there

Andriamanitra: yeah it worked in game

Andriamanitra: i only got 75% despite passing the tests so i looked it up to see where i went wrong

Default avatar.png Rosener: you forgot to convert to integer before you sorted descending, right? or did you take another path

Andriamanitra: i didnt think to remove duplicate primes i think

Scarfield: its in contributions and not approved, i doubt you had that exact puzzle in coc, but another very similar one

Andriamanitra: can't tell if that's *the* issue because it doesn't show the validators

Andriamanitra: it is accepted, it just doesn't show who approved it

Scarfield: ah true

eulerscheZahl: that's a really old contribution. from before the moderating system

jacek: before the System? is this possible?

eulerscheZahl: before the 3 votes for or against a contribution, there was a set of users who got permission by CG to moderate the puzzles. only 2 approvals needed

Andriamanitra: myeah it's also some kind of protected, doesn't let me edit it

eulerscheZahl: you can see some puzzles that got approved with only 2 votes

Andriamanitra: would be nice to add a visible test with duplicate primes

eulerscheZahl: and this puzzle is from even before that 2 user vote

eulerscheZahl: there are some old contributions with obvious flaws (not only CoC, also regular puzzles)

eulerscheZahl: but no one except G can edit them

eulerscheZahl: CG that is

eulerscheZahl: e.g.

jacek: aww

eulerscheZahl: the ROL takes an argument how far to ROL

eulerscheZahl: but it's always ROL by 3

eulerscheZahl: if you check the contribution itself, it's a dynamic ROL with argument. also the solution from the creator takes that argument into account

eulerscheZahl: but someone (CG?) edited it after, leaving that useless and confusing argument

eulerscheZahl: oh, I can edit it :o that seems new

eulerscheZahl: in the past the edit button of the contribution was disabled

eulerscheZahl: and the contribution was out of sync with the puzzle visible on the CG website

eulerscheZahl: and I just realized that I wrote a wall of text. Sorry

Scarfield: ban !

Astrobytes: was gonna say, euler's overly complex answer

eulerscheZahl: can I ban myself? i'll try with kick

Scarfield: xD

eulerscheZahl: nope

inoryy: your case will be reviewed by the golf board at the earliest

Astrobytes: hehehe

eulerscheZahl: that's valuable CG history

eulerscheZahl: you should all attend euler's history class

Astrobytes: love it, resident historian and biographer

Astrobytes: they should pay you really

eulerscheZahl: oh that's fine. I paid myself with a teapot :P

Astrobytes: lol, you gonna explore that any further?

eulerscheZahl: probably not

Astrobytes: good POC regardless

jacek: Automaton2000 whats the verdict?

Automaton2000: not that i don't like java


eulerscheZahl: too white

jacek: too racist

Scarfield: hey hey Mr race pattern :p

Astrobytes: lol oh dear

Scarfield: there are other colors, but the site is a bit weird with searching for a brand/type

Astrobytes: All teapots must be created in the image of their Lord & Master, darkhorse 64

Scarfield: also my german ist nicht so gut

Scarfield: yesterday i got a youtube recommendation for a video with the utah teapot, had no idea about the error 418, but learned why euler named the contribution as such

Astrobytes: that's the teapot protocol RFC right?

jacek: Baader-Meinhof Phenomenon?



Astrobytes: that one yeah

Scarfield: noo too slow

Astrobytes: Slowfield

Scarfield: xD

Default avatar.png mudiko: you cant print to check variables sometimes

Default avatar.png mudiko: what else can i do

Default avatar.png mudiko: is there another way to log

Default avatar.png mudiko: in python

Astrobytes: flush

Astrobytes: flush stderr that is

Default avatar.png mudiko: ty

Andriamanitra: on codingame printing to stderr is probably the best you can do, but you should look up pdb and breakpoint()

Scarfield: for (int genome = turn; genome < popSize; genome++) { for (int gene = turn; gene < geneCount; gene++) { ...

Scarfield: :'( genome should start from 0, this took hours to find piwiu

siobahnv: hey, just joined! Was trying out The Descent in JavaScript and when I tried to console.log an array it just print the first bracket... halp?

jacek: print to stderr?

siobahnv: So console.error() instead of console.log()?

siobahnv: Though stackoverflow is also suggesting this: process.stderr.write()

siobahnv: oofph, console output didn't like those

siobahnv: Sweet, console.error() worked!

siobahnv: Little beginner unfriendly though? or how would one know to use console.error() instead of console.log() for javascript?

jacek: there are comments

siobahnv: true, there is in the base code: console.error('Debug messages...');

SpaceNerd111: I just joined also. There is a menu on the left hand side of the screen where you can get hints. The pseudocode given helped me figure out The Descent

siobahnv: ah fair, I didn't check out the hints :)

siobahnv: I'm hoping to get a few friends hooked, but they're beginners and concerned about them getting frustrated... and "feedback" helps a lot I've found when debugging...

Astrobytes: there's also a custom testcase feature in the puzzles, to aid with debugging

siobahnv: ++

Default avatar.png Bam9: help pls. what does this mean? [int(i) for i in input().split()]

Default avatar.png Bam9: Is this even a beinners course?

Default avatar.png Bam9: beginners*

Default avatar.png JBM: it isn't

Default avatar.png Bam9: Where can I find the beginners course?

siobahnv: maybe try the easy stuff?

Default avatar.png Bam9: damm those are considered easy? Im frustrated already.. :(

Default avatar.png Bam9: Ill still continue to try

Default avatar.png Bam9: Thank you!

Default avatar.png Fredysred: Try clash of code... its against other players but the tasks there are simpler than the ones from puzzles... at least in my opinion

siobahnv: the hints mentioned above^^^ might help too?

siobahnv: I found I needed to google on the side ;P

siobahnv: this is a useful site

Default avatar.png Bam9: Alright thanks fredy! The hints are confusing other from the psuedocode and reading the solutions to understand.

siobahnv: fair

Default avatar.png Bam9: oo alright, thanks sio. Ill use it

CyrusTheCurator: I'm getting so discouraged. Every time I learn a new framework or wrap up a new project I still feel no closer to finally landing a junior job.

siobahnv: <3

AntiSquid: that's called training to become a unicorn CyrusTheCurator

AntiSquid: just focus on one thing instead

AntiSquid: make a project for yourself

siobahnv: I find the hunt for a job is much like coding, gotta get used to rejection (and ghosting) similar to buggy code before you land a job or get working code :P

AntiSquid: i am saying focus on one thing because you could research a company and apply for one of their junior roles based on what they need and what you know

AntiSquid: or just apply for testing code, dull but it's an entry role

Putnam3145: i am reading my weekly challenge code from 11 hours ago and finding it weirdly galaxy-brained

Putnam3145: like, my own code?

Putnam3145: galaxy-brained in the minorly pejorative sense

Putnam3145: i.e. "might've overcomplicated it"

siobahnv: :joy:

Default avatar.png Bam9: finding clash of code super hard too. Should i quit trying to learn programming??

CyrusTheCurator: siobahnv, I like your mentality, hehe

CyrusTheCurator: Yeah, often I'll find DRYer ways to refactor even recently written code, so I try to spot-check things as I see them


CyrusTheCurator: they totally abstracted my message :I

Gorbit99: Bam9 programming is a difficult thing, and codingame isn't an easy beginner challenge

Gorbit99: I'd suggest checking out other options first, ones that actually teach you programming and don't just test your algorithmization skills

Default avatar.png Bam9: oo I see. Alright thanks Gorbit99! Any suggestions for what I can use?

Gorbit99: my personal practicing site is codesignal, similar to this in theory, less gamified, but it puts you through the very basics

Gorbit99: of course this after you already have the basics down

Default avatar.png Bam9: alright thanks man

Gorbit99: programming sadly starts with sitting down and learning a bit, what is the lang you want to learn?

Default avatar.png Bam9: Python

Default avatar.png bpeter: Hey Gorbit

Gorbit99: I don't know a good tutorial for that one, but I'm sure others have a suggestion

Gorbit99: Hey bpeter

Default avatar.png Bam9: Oo

Default avatar.png Bam9: What language do you think I should learn?

Gorbit99: that just depends on what you want to achieve with ti

Gorbit99: it*

Default avatar.png Rosener: Python is a fine language, stick with it if you're aimless for now

Default avatar.png Rosener: As you learn more about programming in general and other languages, you might find yourself drawn to them for the aims that you're interested in

Gorbit99: at which point you won't need as much time to learn a new language

Gorbit99: just like with actual languages

Gorbit99: but of course, if you already have a goal in mind, it's just natural to select a first language that helps in that goal

Gorbit99: motivation is key

Default avatar.png Bam9: alright thanks man

Default avatar.png bpeter: python is very good to platforms like CodinGame

Default avatar.png Rosener: especially for CoC since it can be very compact and quick to write

Default avatar.png Rosener: (if you like to do that)

Gorbit99: then there's ruby :^)

Default avatar.png bpeter: yes ruby

Default avatar.png bpeter: i use C++, but same i very fast

Andriamanitra: always a pleasant surprise when you get 100% correct in reverse mode only to find out that passing the validators requires handling extra cases you had no way to know existed

Andriamanitra: suddenly 100% is 25%

Default avatar.png Iuykza: Ouch.

Default avatar.png Bam9: Can I ask someone for help??

Default avatar.png Iuykza: I can answer as long as it's a Javascript question.

Default avatar.png Bam9: dam its a python question

Default avatar.png Iuykza: Well go ahead anyways, someone might know.

Gorbit99: Bam9 it's rare that a question is actually language specific

Default avatar.png Bam9:

Default avatar.png Bam9: so this is a guessing game to learn python for beginners

Andriamanitra: "never ask to ask, just ask instead" is solid piece of advice

Gorbit99: ^we have this same "rule" on a discord server even

Default avatar.png Bam9: and im having a syntax error on

Default avatar.png Bam9: line 9

Default avatar.png Bam9: idk whats wrong

Andriamanitra: your indentation is off

Default avatar.png Bam9: oo alright lol. noted :D

Default avatar.png Bam9: oo

Gorbit99: an important thing to mention in these cases is what the error says

Default avatar.png Iuykza: hackerman.jpg

Gorbit99: just for later reference

Default avatar.png Bam9: o

Gorbit99: good old python with it's forced indentation, really nice

Default avatar.png Bam9: lol

Andriamanitra: i would suggest sticking to 4 space indents with python, it's the most common standard and makes it obvious when you're doing things wrong

Gorbit99: isn't 2 space the most standard:

Gorbit99: ?

Andriamanitra: unless you're doing code golf, then 1 space indent is what you want :D

Andriamanitra: almost no one uses 2 space indents with python, i think google might?

Andriamanitra: pep is 4 spaces

Gorbit99: well, tabs are usually 4 spaces and that's what you are imitating with spaces

Gorbit99: but I really had this notion, that 2 spaces => python code

Andriamanitra: ruby is traditionally 2 space indents, maybe you're confusing it with that

Gorbit99: I'm one of those weird people, who doesn't actually use ruby, just in golf, and I don't see any ruby code ever

Default avatar.png Iuykza: how do we send snippets?

Default avatar.png LBP: git

Default avatar.png LBP: sorry, wrong post

Gorbit99: if they are long enough, it will be pastebinned

Gorbit99: so just post them

Default avatar.png Iuykza:

Default avatar.png Iuykza: Doing this challenge.

Default avatar.png Iuykza: It fails on test 5.

Default avatar.png Iuykza: Which has 1024 players, and I'm not sure how to even debug that.

Gorbit99: error is in outcomes, S L should be C L

Gorbit99: had the exact same error myself when I did this

Default avatar.png Iuykza: seriously? :o

Default avatar.png Iuykza: holy jesus you are a god.

Gorbit99: no, I'm a Gorbit

Gorbit99: easy to mistake, similar name

Default avatar.png Iuykza: Didn't expect you to be able to understand my code.

Andriamanitra: how evil of the creator to come up with two things that start with same letter

Gorbit99: I didn't look at the code, this specific challenge is a hell to get down into a win-lose table

Gorbit99: well, it wasn't them

Gorbit99: afaik it was big bang theory

Default avatar.png Iuykza: yep

Default avatar.png Iuykza: I'm surprised my code wasn't that much more complex than the top answer.

Laminator: always nice when I just barely have enough time to solve a shortest problem, let alone shorten it at all

Default avatar.png Iuykza: Relatable. I'm not good at those either.

Gorbit99: it's practice

Andriamanitra: there are some clashes that i'm sure i couldn't solve in an hour let alone 15 minutes


Gorbit99: there's a super hard one

Gorbit99: pathfinding in 15 minutes

Default avatar.png Iuykza: I was doing a clash with reverse mode. Thought it was the fobonacci sequence. Kept failing the tests. Ended up being something simple: Math.floor(x * 1.5)

Andriamanitra: most reverse mode clashes are just stupid

Andriamanitra: there are some well-designed ones where each test case clues you in a little bit more but they're rare

PatrickMcGinnisII: I just only started clashes cause of the new quest xp

Gorbit99: oh, pathfinding in 15 minutes doesn't exist anymore

PatrickMcGinnisII: there is a clash puzzle list w/ descriptions for all of them somewhere

Default avatar.png Iuykza: I don't understand what that one is asking for. What's pathfinding?

Gorbit99: I use euler's CG puzzle search

Gorbit99: pathfinding is when you need to find a path between 2 points given a maze or similar

Andriamanitra: i remember doing pathfinding through a 3x3 "maze", but that's so small you just code all the possibilities :D

PatrickMcGinnisII: holy crap 706 of them

Gorbit99: well, this was full on pathfinding

Gorbit99: I finished it in around 10-12 minutes

PatrickMcGinnisII: Tiramon were u able to do don't panic in under 200 chars in php?

PatrickMcGinnisII: I'm stuck at 380 chars

Default avatar.png pydlv: I hate reverse

Default avatar.png pydlv: worst mode

Default avatar.png pydlv: dude this puzzle must be broken

Allis: Which one?

Default avatar.png zile151: personally i don't think any reverse problems are "broken", I just think I waste too much time figuring out the less elegant reverse problems when I could be getting better at coding

Default avatar.png zile151: just my 2 cents

Default avatar.png pydlv: nvm its not broken Im just stupid and misread the thing. I just though so because no one out of 5 people scored higher than 70%

Allis: Sites like this really aren't great for getting better at coding. They're good for practicing what you already know, and that has some value.

PatrickMcGinnisII: Allis I have to disagree, there is alot of lazy programming (just look at Microsoft), the tricks to squeezing efficiency in processing and storage are explored in this site. The application of some really in-depth maths are also used and are perfectly usable in the real world.

Gorbit99: this site isn't very good for practicing algorithmization, it can be done, but you will be faced with more hurdles than on other ones

Gorbit99: especially coc, that's terrible for that purpose

PatrickMcGinnisII: Allis, I'm old, I used to have to program the crap out of a 386 processor to get a decent frame rate. When the pentiums came out, the added "power" lead to lazy coders.

StarShip: Do you guys think clash of code is the best resource on this site, or are there any better ones?

PatrickMcGinnisII: yes, coc ... I never did much of it until today... its not enjoyable to me. but with 700+ super easy puzzles in it...people can practice...hell need practice.

StarShip: yeah it usually boils down to keeping you comfortable with your language of choice, and quick thinking, other than that feels mostly trivial

PatrickMcGinnisII: I enjoy the contests, and I do the puzzles in between. I've done 100% of the easy ones

Gorbit99: coc is definitely just like a puzzle, contributions are kept easy enough to do in 5 to 10 minutes

Gorbit99: it's advertised as giving you a 5 minute break inbetween whatever you're doing

Gorbit99: of course, the best part is either actually contributing and coming up with your own challenges or competitions

PatrickMcGinnisII: The CP you get from COC goes away, so unless you are doing 100 a day...I don't see much of a point.

PatrickMcGinnisII: ok, contributions...yup i guess so. I haven't done any, but I do up/down vote a bunch as they come up

StarShip: definitely a nice break from other platforms like leetcode lol

Gorbit99: coc rankings don't go down as quickly as you would think

Gorbit99: I usually get back in every 2 months or so, grind it to 8th to 10th, and leave it like that for the next 2 months

Gorbit99: and when I come back I tend to be around the 80th place, with only 10 clashes necessary to get me back to a similar standing

Allis: I think the decay doesn't even start if you do one a day, no?

PatrickMcGinnisII: my preferred lang. isn't really coc friendly...the ruby/python have an advantage

Gorbit99: Allis I had days, where I just checked my ranking and it stayed where it was for like a week

PatrickMcGinnisII: CG is making me play it so I can get the easy XP from the quests

PatrickMcGinnisII: smh

Gorbit99: well, that's easily solvable, once you have them done :P

Gorbit99: the most difficult coc quests are definitely the last 3

PatrickMcGinnisII: current quest is 50 clashes..I've done 19 ... and i suck

Gorbit99: doesn't matter

Gorbit99: I definitely sucked, if not even more, when I was at 19

PatrickMcGinnisII: the code golf quests are impossible in php

Gorbit99: it's not even about winning at that point, it's about getting to know your language

Gorbit99: I learned what I know in ruby basically entirely on this site

PatrickMcGinnisII: I don't like sloppy code, I have a tendancy to not use optimal methods when I'm in a hurry and I don't evaluate error_logs and such.

Gorbit99: well, then coc isn't for you

Gorbit99: it's about sloppy hacks

PatrickMcGinnisII: yea, coc isn't for me. I can do it, but I like testing my code more

PatrickMcGinnisII: crap, hungry..gotta cook. glhf.