From CG community
Jump to navigation Jump to search

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

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

Marchete: Item* i = myVector[0];

Marchete: myVector.push_back( something);

Marchete: and now the pointer is no longer valid

Marchete: \o/

Marchete: god bless f*cking C++

Allis: @Marchete That makes sense, though; growing a vector can cause a reallocation, which in turn might involve a move.

Marchete: I know it makes sense

Marchete: but in C# and similar is simpler

Marchete: also, in debug mode they should warn in some way

Marchete: the compiler should detect that something is wrong

Allis: According to, Clang's static analyzer can only detect invalidated pointers on std::string.

Allis: That indicates that they're aware of the issue and making it work for std::vector and other collections is a hard problem.

Marchete: well, almost a day wasted in this

Allis: ¯\_(ツ)_/¯

Marchete: :expressionless:

Marchete: and Illedan_ dropped me in ktulu, not happy today

Default avatar.png fazli1702: kanina cao ci bai

dbdr: Marchete: that invalid pointer is a typical example of what rust fixes in C++:

Marchete: good bless smart compilers

Marchete: Rust sounds interesting, but I can't see a similar sintaxis to neither C++ or C#

Marchete: I code in c++ very similar to what I do in C# (and that's why I struggle with it), but Rust is like a new whole deal

dbdr: C# and C++ are also different, no

dbdr: ?

Marchete: but I code similarly

dbdr: yes, I see how that will lead to crashes in C++

Marchete: I mean, I do some dirty C++ that is fast, but looks like a lot to I do in C# :D

Marchete: what*

Marchete: C# is like "wow you are trying to pass a red light, I got you bro"

Marchete: and C++ is like "without brakes!!!! go brrrrrr!!!"

Marchete: I fixed my chain split, but now I need to see what is happening in border boxes

Marchete: in corners


dbdr: and

Marchete: :D

jacek: meh. c++ will work when you read some garbage from memory, at least for a while

jacek: so silent in here

jacek: i thought people would be more hyped

GoogleJeff: I'm totally hyped

Marchete: ¯\_(ツ)_/¯

GoogleJeff: HYPE

jacek: yay silver

Thiesjoo: Nice jacek!

Default avatar.png ChandraKanthPasunuru: when i submit my stuff in c#, this ruby and python all ways win this shit. because of few characters they get.

uvBoss: calm down dude

Default avatar.png ChandraKanthPasunuru: bring c#9 then i will win, maybe i need use F# to win

Default avatar.png ChandraKanthPasunuru: F# > ruby and python

Simonka: *laughs in python*

Default avatar.png ChandraKanthPasunuru: @admin bring c#9 man

jacek: the problem is you bring knife to a gun fight

Default avatar.png ChandraKanthPasunuru: yeah i know. LOL

Default avatar.png ChandraKanthPasunuru: i just want play this can in c# for now. later i will paly it with F#.

Default avatar.png ChandraKanthPasunuru: but c# 9.0 is as good as python but faster.

Default avatar.png ChandraKanthPasunuru: oh shit, for the first just now i used less char in the code then a python ohhhh okkk.

Default avatar.png ChandraKanthPasunuru: it put me in top of lobby board.

Marchete: ahh Sokoban, how much I hate this game

eulerscheZahl: :head_bandage

eulerscheZahl: :head_bandage:

jacek: hm?

eulerscheZahl: maybe i should have finished it before putting as WIP

eulerscheZahl: now that one use keeps commenting

Astrobytes: lol, you made Sokoban

eulerscheZahl: not finished yet

eulerscheZahl: just started this morning before playing soccer

Westicles: Ah, Sokoban. If you are looking for some with thousands of moves there are some good ones here

eulerscheZahl: thousands of moves is a problem with the CG SDK

eulerscheZahl: except if i ask the user to issue multiple actions per turn

eulerscheZahl: and i think sokoban is better as a puzzle than optim anyways

eulerscheZahl: so it doesn't have to be too hard

Westicles: Sounds good. Incidentally, the guy behind that website claims to have the fast solver in the world, he links to it (c code) in the description

eulerscheZahl: that would make an optim pointless, wouldn't it? :D

Westicles: Yeah, for an optim I think it would have to be designing levels

eulerscheZahl: sokoban multiplayer: you get some initial board and can add walls to it

eulerscheZahl: then you solve the board of your opponent

eulerscheZahl: i'll show the door to myself. no need Marchete :D

Marchete: bender4 isn't already sokoban on steroids?

Marchete: it's not your fault

Marchete: I remember some old sokoban in CGA graphics

Marchete: and I hated it

Marchete: since then


Marchete: yeah this one

eulerscheZahl: i agree, bender and sokoban share some similarities

eulerscheZahl: and space maze

Marchete: I made this meme

Westicles: That video makes me nostalgic for Ultima IV

eulerscheZahl: damn you SDK

eulerscheZahl: BufferedGroup isn't working well with setScale

eulerscheZahl: drawing an image larger than the player height (1080px) and scaling it down now there's a black bottom

Zenoscave: JBM you mad genius

Default avatar.png JBM: huh?


Default avatar.png JBM: oh that

Zenoscave: I knew what video would play but still I clicked it

Default avatar.png JBM: you knew you wanted to

Zenoscave: I had to be sure

eulerscheZahl: that's an old one, surprised you haven't seen it before :D

Zenoscave: I don't have enough time to check contributions these days

Default avatar.png JBM: well at least you knew a video was coming up

Zenoscave: html5 == video

Zenoscave: invariably

Default avatar.png JBM: yeah that's the shortcut

Zenoscave: eulerscheZahl new optim?

Zenoscave: what's that mario-esque looking printscr

eulerscheZahl: puzzle, not optim

Zenoscave: ah interesting

Zenoscave: block pusher puzzle?

eulerscheZahl: you know sokoban, don't you?

Zenoscave: not by that name but I probably can guess the task

Zenoscave: lmgtfy

eulerscheZahl: *lmgtfm

Zenoscave: ftfm

jacek: mlp:fim

Zenoscave: no jacek

eulerscheZahl: now you lost me

Zenoscave: I see it now. How many levels are you porting/plan to port

eulerscheZahl: 30

Zenoscave: cool

eulerscheZahl: and i found a bug in the SDK

Default avatar.png JBM: what a surprise

eulerscheZahl: :tada:

eulerscheZahl: will report it later

Default avatar.png lior5654: why is this such a meme, use codeforces instead

eulerscheZahl: codeforces has a different audience than codingame

eulerscheZahl: the unique thing here is the multiplayer section

Default avatar.png lior5654: yeah I just saw clash of code

Default avatar.png lior5654: it's really fun

Default avatar.png lior5654: but

Default avatar.png lior5654: the problems are wayy too trivial

Default avatar.png lior5654: no graph theory, trees, geometry etc

eulerscheZahl: that's meant for a short break, nothing serious

Default avatar.png lior5654: I see

eulerscheZahl: the normal puzzle section can be harder

Default avatar.png lior5654: I se

Default avatar.png lior5654: thanks

eulerscheZahl: e.g.


eulerscheZahl: yet if you want to practice the standard algos like you need them for ICPC, you're better placed at codeforces

eulerscheZahl: if you want interaction of your program with other programs, try one of these:

Default avatar.png lior5654: shortest code is not fair against c++ users?

Default avatar.png lior5654: in clash of code

Default avatar.png lior5654: I use a 3000 lines template

Default avatar.png lior5654: I finish first but get like 4th because of stupid python users

SPDene: just switch to ruby and beat them

Hjax: part of the game is selecting the right tool for the job

Default avatar.png lior5654: python is too slow tho

Hjax: and your 3000 line template is definitely not it

Default avatar.png lior5654: I use c++, just like most ICPC / IOI contestants

SPDene: speed isn't important in reverse mode

Hjax: its clash, execution speed doesnt really matter

Hjax: if you want execution speed to matter, go play a search heavy multi

Default avatar.png lior5654: for example, there was a round in which I finished in 1:50

Default avatar.png lior5654: A python user with 9:17 got before me

Default avatar.png lior5654: not execution speed

Default avatar.png lior5654: time took to finish

Hjax: well, obviously someone is going to use their time

Hjax: its a code golf puzzle

Hjax: finishing super fast is just a mistake

Default avatar.png lior5654: yes, but speed should mattter..

Hjax: it does in the other modes

Default avatar.png lior5654: I guess that's the rules of the game

Default avatar.png lior5654: oh really? noice

SPDene: I'm not sure you understand the criteria for winningshortest. It's about the number of characters in your code. speed isn't important

Hjax: reverse and fastest care about how quickly you answer

Hjax: shortest cares about code size

Default avatar.png lior5654: so in shortest I should even avoid spaces?

Default avatar.png lior5654: lmao

Hjax: if possible

Default avatar.png lior5654: sounds cool

Default avatar.png lior5654: thanks

Astrobytes: I've seen a lot on CG but a 3000 line template for shortest CoC is a first :D

Hjax: lol agreed

eulerscheZahl: be careful about the 100k char limit

Default avatar.png lior5654: aight I took your advice

Default avatar.png lior5654: this time I was abit slow but 100 char python code

Default avatar.png lior5654: and I am first

Default avatar.png lior5654: so yeah that works I guess

eulerscheZahl: are the others still playing?

eulerscheZahl: then you might still drop

Default avatar.png lior5654: oh wait there are 8 minutes left

Default avatar.png lior5654: oops

Astrobytes: Gotta use the right tools for the job, and pay attention too ;)

Default avatar.png lior5654: I might fall on int(input())

Default avatar.png lior5654: is there a shorter way

Astrobytes: lesson learned!

Default avatar.png lior5654: to get an integer from stdin?

Default avatar.png lior5654: (in python

eulerscheZahl: i don't think so

Default avatar.png lior5654: I did s,b,g=(int(input(),int(input(),int(input())

eulerscheZahl: usually Ruby is a bit shorter

eulerscheZahl: oh, then you can improve it

Default avatar.png lior5654: that's the shortest input receival I thought of

Hjax: you can do tricks like

Hjax: a=input

eulerscheZahl: s,b,g=map(int,input().split())

Hjax: a(), a(), a()

Hjax: code golf often makes me wish "lambda" was a shorter word

Default avatar.png lior5654: I am a C++ programmer, did not know aout these

eulerscheZahl: oh, it's 3 lines, not 1 lines with 3 numbers

Default avatar.png lior5654: yeah someone wrote code 12 characters shorter than mine

Default avatar.png lior5654: oof

Default avatar.png lior5654: ah smart

eulerscheZahl: some users learned python or ruby just for golfing

Default avatar.png lior5654: he used a lambda

Default avatar.png lior5654: f=lambda:int(input())

eulerscheZahl: others learned C++ for the bot section

Default avatar.png lior5654: euler do you have a codeforces handle

Default avatar.png lior5654: I just checked your CoC profile

Default avatar.png lior5654: impressive


eulerscheZahl: CoC?

Default avatar.png lior5654: oh I meant

Default avatar.png lior5654: codinggame

Default avatar.png lior5654: Coc is clahs of code

Default avatar.png lior5654: whoops

eulerscheZahl: nowadays i'm mostly doing contests and idling in the chat when there is no contest

Hjax: euler is frequently #1 on this site

Hjax: although it seems royale has passed him again

Default avatar.png lior5654: what are rankings based upon

eulerscheZahl: click the ranking

Hjax: mostly bot programming and contests

eulerscheZahl: then you see the score for each category (you can further expand them)

Default avatar.png Pablo_: @euler do you have a programming job aswell?

eulerscheZahl: yes

Default avatar.png lior5654: are achievements bugged?

eulerscheZahl: no. sometimes they take a bit to update

Default avatar.png theBatman: Are there bots in every Coc match?


Astrobytes: only if there are too few human players

eulerscheZahl: the top few are bots (with 40k+ games)

eulerscheZahl: about the bots:

Astrobytes: (I let you do that btw, not feeling fast today :P )

Hjax: most of them

Hjax: oh scroll

eulerscheZahl: somehow that's what I was expecting Astrobytes :D

Astrobytes: hehehe

Q12: How to limit the run time of program? like that the player would not be able to run a program that her run time is bigger than the limit, in contribution

eulerscheZahl: are you talking about SDK contributions or classic input-output based?

Q12: I don't know what is SDK I'm taking about an easy puzzle

Q12: *talking

eulerscheZahl: with any animations or alike?

Q12: no

eulerscheZahl: you have to take what CG offers you then

eulerscheZahl: which is 1s to produce some output

jacek: 3. take it or leave it

Q12: haha

Q12: Thanks eulerscheZahl

eulerscheZahl: after that 1s the user program is terminated and it's counted as wrong answer

Q12: So I can just make the input bigger and it would do the same right?

Astrobytes: I guess if it's an efficiency thing you could make a larger test case of some arbitrary size that should be solvable in less than 1s

Q12: its like limit the run time

Astrobytes: Yeah

Q12: thanks

Default avatar.png lior5654: clash of code in shortest code mode is basically "use js or ruby or be bad"

geppoz: +python

Astrobytes: you can always make a private clash and choose the mode + language

geppoz: hint: learn 2 languages, one for short, one for fast

geppoz: i.e. python+javascript

Default avatar.png JBM: not sure which is which oO

geppoz: for me pytohn short, js fast

Default avatar.png tssw: js fast?

geppoz: fast to solve problems, not to execute

geppoz: ;)

Default avatar.png lior5654: for me either c++ or python for fast , depends on input manipulation

Default avatar.png lior5654: python for shortest

BitThief: python shortest, python or js for fast

Default avatar.png lior5654: I breathe c++

Default avatar.png Elysweyr: js is also quite short

Default avatar.png Elysweyr: but you need to know what you are doing xD

Default avatar.png Elysweyr: and functional problems are much more convenient in js

Default avatar.png Elysweyr: (compared to python!)

Default avatar.png tomy00019: (c++ for faster compilation secure)

codeing: what are you think about this code ?


codeing: look there.


eulerscheZahl: what's in that zip? just a code file?

eulerscheZahl: won't download it, too much effort

codeing: a java project in zip file.

codeing: this selection sort.

codeing: with* selection sort.

codeing: does this algo optimal ?

eulerscheZahl: regarding runtime? selection sort is never optimal

geppoz: ruby question:

geppoz: in IDE it seems gets strips the trailing LF

geppoz: in my environment seems not...

geppoz: *I mean the instruction "gets"

eulerscheZahl: C# answer: Console.ReadLine strips the LF

AntiSquid: why share a zip in chat though? you can upload to pastebin or github or whatever ...

AntiSquid: codeing

eulerscheZahl: or even paste it here

eulerscheZahl: which is why i refused to open it

AntiSquid: might be multiple files

eulerscheZahl: let's just say i'm not in a mood to clear my download folder afterwards

AntiSquid: what if someone wants to play CTF on CG though? :P

codeing: i get it @AntiSquid

eulerscheZahl: quick question: is it me or do you get a board like this?

eulerscheZahl: i'm utterly confused

eulerscheZahl: seemed fine in testing. when i saved it, i got that nonsense

eulerscheZahl: oh, I think I understand what's going on: there must be some caching in the testcases. I changed the input format. If my new parser tries to read the old files, it will be something like this

eulerscheZahl: does that count as an SDK bug?


AntiSquid: ever test

Default avatar.png ChandraKanthPasunuru: what is that euler?

Default avatar.png ChandraKanthPasunuru: is that a game?

eulerscheZahl: it's sokoban

eulerscheZahl: you can play it here (and on many other websites)

eulerscheZahl: thanks AntiSquid. I reported it on discord, will move it to github

AntiSquid: every * Q_Q

eulerscheZahl: the maps in the old format start with width height

eulerscheZahl: and the new parser assumes a single line and assumes that anything >= 6 is a pusher

eulerscheZahl: as width and height both are, you get 2 of them :D

eulerscheZahl: if you download and reupload my zip file, it should be working fine

Zenoscave: eulerscheZahl do you have your A*C highscores written somewhere?

Zenoscave: not the solutions just the scores

PatrickMcGinnisII: OMG, Garbage Balls everywhere

Hjax: 0.02 above the boss, nice

MadKnight: what game Hjax ?

Default avatar.png Farma12: what's up with the puzzle of the day? always get a timeout :/

Default avatar.png Farma12: tried with strings and log, small advice how to get it faster?

Default avatar.png Farma12: my solution works, it's just too slow :/

itzblinkzy: @myNickName01 thanks for sharing your code im fairly new to this

myNickName01: sure

myNickName01: i haven't played in months

myNickName01: :)

Hjax: @MadKnight Code of Kutulu

Hjax: playing the unofficial contest

Hjax: im mid gold right now

blasterpoard: I'm looking at new kutulu legend games right now; people still don't spam light properly


Hjax: my bot is super bad right now, im surprised its gold

blasterpoard: you can get to gold while ignoring slashers

Hjax: i told my bot to try to avoid standing on their line of sight

Hjax: but that was it

Hjax: its not aware of their timers or states at all

blasterpoard: that's better than almost anyone in silver

Hjax: my scoring is awful, my bot walks into danger a lot

blasterpoard: what kind of danger?

blasterpoard: getting surrounded or missing unavoidable damage at depth 1-2?

Hjax: wanderers mostly

Hjax: it will see wanderers on both sides and not realize it can slip through

Hjax: sometimes it just stands still or turns around and walks into a wanderer :D

blasterpoard: voronoi turned out to be a good heuristic for avoiding getting boxed in

blasterpoard: and some sort of a simulation that is just a couple of turns deep is nice to have

Hjax: yeah i dont have any sort of sim

Hjax: i just have a trash heuristic that scores all legal moves

blasterpoard: I think depth 5 was good because of slasher phases

blasterpoard: *good enough

Hjax: and picks whatever optimizes its scoring function best

Hjax: but the scoring function isnt particularly good

blasterpoard: that can get far enough too; that's how my bot at rank 6 works

Hjax: i need some way better heuristics if i want this method to work without a search

Hjax: its hard to strike a balance of avoiding wanderers and being near other explorers

blasterpoard: aren't the other explorers avoiding wanderers too though?

Hjax: not really

blasterpoard: avoiding wanderers and staying with the others should be the same thing


Hjax: i die alone while everyone else eats wanderers

blasterpoard: you don't need to follow everyone, just someone

blasterpoard: yes, both your bot and blue bot play badly, but the correct way to play that map is to just go to the closest explorer

blasterpoard: and whenever it's "2v2", keep spamming light as much as possible

Hjax: i feel like light is less of a concern than how trash my movement is

blasterpoard: light is important

blasterpoard: I posted a reaply a while back

Hjax: i saw it

blasterpoard: simply make sure to go to whoever is closest in the early game, and if multiple people are equally distant from you, go to the one that's closer to your position 1 turn back

blasterpoard: that's the best you can do for first ~6 turns


Hjax: well that is better

blasterpoard: yes, that's how you should do it

blasterpoard: even if blue wasn't very cooperative

Hjax: my bot doesnt really know how to avoid slashers if they are near it

blasterpoard: just note that light lasts longer than 2 turns

blasterpoard: you need sim for that

Hjax: it didnt want to leave blue

Hjax: but blue didnt want to leave the slahers

Hjax: slashers*

blasterpoard: don't worry about that, bots higher up on the leaderboard will play along more

Hjax: what do you mean light lasts longer than 2 turns?

blasterpoard: you keep cancelling one light with another

Hjax: doesnt look like it

Hjax: i have light for 6 turns

Hjax: each light lasts for 2

blasterpoard: ok, then I must be misremembering

blasterpoard: it's plan that lasts 4

Hjax: i should probably only light if theres a wanderer thats path would be affected by it

blasterpoard: yes, and you used it too soon and took extra isolation dmg because of it

AnyaA: how do I beat boss 2 in wood 2 league in coders strike back javascript?

Hjax: theres no correct answer to that question

Hjax: make your bot better and it will win

AnyaA: ok?:

Hjax: bot multis are by design very open ended

Hjax: you can look at the forums for ideas on different strategies you can use

Hjax: but theres no right answer

AnyaA: ok


my massive fail

AnyaA: clash od code = i suck

Bassel: Nah

Bassel: You just need to be fast

AnyaA: I can't even do white man!

Bassel: This task isn't that trivial

Bassel: Practice makes difference

AnyaA: i know

Bassel: lol

Bassel: Some weird tasks