Chat:World/2021-10-02

From CG community
Jump to navigation Jump to search

Wontonimo: cool Cegwe, how did you do it?

Wontonimo: generally speaking, i'm not asking for exact code

Cegwe: I used a bias towards the middle of the board, and made the bot find the space where it was adjacent to the most 2 in a row places at the same time (favoring blocking over anything)

Cegwe: It took a lot of tweaking and tinkering but I was happy with the result

Cegwe: The bias was super small by the way, it was only for tie breakers

Wontonimo: nice. my bot is MCTS with scoring based on win/loss (not point difference), so it gives up easily and doesn't really try to crush the enemy when winning

Cegwe: I didn't even think to take point difference into account, maybe I could take the lead if I did

Wontonimo: i think i'll next try UCT with scoring as the valuation

Wontonimo: maybe some local sim to find those kinds of bias and constants you found manually.

Cegwe: I'm wondering if the time given for input is enough to go deeper than one layer of play? It would be cool to simulate the best course of action in a higher depth

Cegwe: I'm not really experienced in any botting at all, so this game was super fun to figure out

Wontonimo: i'm simulating something crazy like 100K playouts, but the selection space is greatly pruned down to about10 moves

ProCoder03: You guys already wrote a sim :confused:, why am I not able to write sims :sob:

Cegwe: Wow

Cegwe: I'm only looking at one layer lol

Wontonimo: i think that is something that is killing my bot, 10 moves out of 100 is too agressive

Wontonimo: yeah, and you are beating me !

Wontonimo: heuristic beats brute force in this game!

Cegwe: I bet if you work on that though you'd be at #1

Wontonimo: maybe. i'm thinking this would be a good game for NN

Wontonimo: conv NN

Cegwe: probably; can you make good NNs on this site? I can't think of a way to make it viable without some sort of file saving

Cegwe: I'd love to give it a shot but I don't even know where to start to be honest - I'm super new to this site and only really started playing a week or two ago

ProCoder03: you have some article about it in codingame.com/learn

Cegwe: Oh sweet I'll take a look

Wontonimo: https://www.codingame.com/playgrounds/58137/alphazero-like-implementation-for-oware-abapa-game-codingame/alphazero-like-implementation-for-oware-abapa-game

Wontonimo: a wonderful contribution by Marchete

Cegwe: oh sweet

ProCoder03: geez, I just overshot this while searching

Wontonimo: I haven't implemented it yet, but several people here have. It is a monster of an undertaking if you haven't written a local sim before

Cegwe: lol going to try to adapt this into my langauge of choice

Wontonimo: my job is NN, machine learning and data science, and I'm passing on it for now (because of the amount of work involved)

Cegwe: yeah I've tried before and it's pretty awful, but I don't work in any computer related field so I don't get so tired of it as quickly as many others do

Cegwe: I feel like keeping this as a hobby instead of a job has helped me keep it fun

Wontonimo: i do both :D

Cegwe: That's pretty awesome

Wontonimo: I'm working on automating an unfolding clicker game right now, a reverse engineering and automation challenge

ProCoder03: did derjack screw his MCTS ??

Cegwe: can you link it?

Wontonimo: https://pmotschmann.github.io/Evolve/

Cegwe: ooh this game

Cegwe: i know this one

Wontonimo: how far have you gotten?

Cegwe: not tooooo far

Cegwe: although my save disapeered

Cegwe: I actually don't remember it's been a while

Wontonimo: black hole reset?

Wontonimo: bioseeding?

Cegwe: doubt it on bioseeding doesn't ring a bell

Wontonimo: ah, then you only scratched the surface

Cegwe: yeah, I have a hard time with resource management games

Wontonimo: it's an optimization problem

Cegwe: for sure

Wontonimo: hint, go for population growth before anything else

Cegwe: are you trying to make it go the fastest?

Cegwe: the automation?

Cegwe: the only type of game like that I ever got far in was trimps

Wontonimo: funny you should say that, a good friend of mine has a similar opinion

Cegwe: Well it was the first one I tried, and since then none of the other ones have really pulled me in like trimps did

Cegwe: Do you have any recommendation on which bot competition I should do next? I want something a little harder, but some of those competitions look way too complex for me

ProCoder03: What have you done yet ??

Cegwe: counting tictactoe was the one I worked on today, but its not approved yet; I did some of the pod racing one, but didn't really like that one by the time I got to bronze league

Cegwe: That's all so far

ProCoder03: try UTTT

Wontonimo: there is a concept called PID controllers that works really well on Coders strikes back and the mars lander stuff

Wontonimo: as far as other challenges ... I had a lot of fun with Tron

Cegwe: ill give uttt a try; I would get into looking at PID but i dont really like the coders strikes back challenge anyways

ProCoder03: Tron uses 2D arrays and DFS, right ??

Cegwe: I'll give tron a try too

Wontonimo: UTTT (Ultimate Tic Tac Toe) was my first attempt at MCTS here on CG. For that it is kinda special to me

Cegwe: maybe ill try one too? I've never implemented that before

Wontonimo: Tron was fun because I got really far using just floodfill

Cegwe: Do you have an article on mcts? I don't really know how it works

Wontonimo: and the pacman game was fun because I got pretty far in that using something like floodfill, more more like "diffusing smell"

Wontonimo: just a sec. i'll get you something

Cegwe: Thank you

Cegwe: Also what's floodfill? I keep seeing mentioned, but don't really know what it means

Wontonimo: this video has great content (not the best video production) https://www.youtube.com/watch?v=UXW2yZndl7U

Cegwe: Thank you!

ProCoder03: wait isn't it MCTS Wontonimo

ProCoder03: the link

Cegwe: its a video by a 'john levine'

Wontonimo: it explains MCTS applied to a situation that is NOT adversarial. To make it adversarial, you need to flip the value of the backprop as it goes up the tree

ProCoder03: so MCTS and flood fill are similar ??

Wontonimo: i was talking about mcts. hadn't got to flood fill yet

ProCoder03: Ohh... my bad

Wontonimo: np :D

Wontonimo: here is a puzzle about flood fill https://www.codingame.com/training/medium/flood-fill-example

Cegwe: so would i just use recursion for it? that seems like the most immediate way to go about it, but I obviously don't know if it's actually any good

Wontonimo: it's really good for calculating areas of control

Cegwe: ooooh floodfill is like the a* pathfinding thing

Wontonimo: kinda

Wontonimo: but yeah, very related

ProCoder03: Do we need to know pathfinding algo to understand floodfill ??

Wontonimo: nope

Wontonimo: you can use floodfill to accomplish lots of things.

Wontonimo: for example, in mars lander 3 I use it to make a scoring gradient from the landing pad. The floodfill

Wontonimo: in this case also increments as it fills,

Cegwe: makes sense to me

Wontonimo: so my lander can at any time lookup the floodfill 2d array and get a distance from the landing pad, even around corners

Cegwe: But the mcts is still a bit confusing, I think I'll need to play with it to understand it

miszu: one thing I don't understand if when I put a seed in IDE and print the grid... then do the exact same thing in visual studio and print the grid, I get two different thing

Wontonimo: hmm , don't know about that miszu

miszu: http://chat.codingame.com/pastebin/0aab8d9f-de02-4b42-8a88-bf6fc6ba34b1

Wontonimo: okay, Cegwe, are you familiar with minimax ?

Cegwe: yes

miszu: same code in ide and visual studio yet different results

Cegwe: maybe this ide or visual studio applies their own modifier to your value, or maybe it runs a different version or something

Wontonimo: so, imagine minimax, and instead of evaluating ALL of the next level at the same time, you evaluate only the most promising 1 branch

Cegwe: ok but sometimes isnt that a fluke?

Cegwe: like it seems pretty good, but not fantastic

Wontonimo: it is, and by evaluating that 1 branch you get more insight into how good/bad it is

Cegwe: oh I see

Wontonimo: now there are two terms that control this,

Cegwe: ok and if its bad you just choose the next best one I assume?

Wontonimo: yeah

Wontonimo: right ... but ...

Wontonimo: if you've only looked at the first layer, then you really don't have much confidence in any of them

Cegwe: ok

Cegwe: so how many layers should I look at before switching to mcts?

Wontonimo: once you expand one of those , you have 2 data points at that top for that 1 branch

Wontonimo: but only 1 data point for all the others

Wontonimo: and you can calculate the uncertainty using probability theory

Cegwe: omg statistic rip

Wontonimo: so, even if that expand was by fluke great, you reduce the uncertainty of that branch ... and the other branches now look more interesting, because their value plus their uncertainty puts them higher than thee one you explored

Cegwe: Oh okay, so do you just use some threshold to decide when the outcome is good enough?

Wontonimo: this is all controlled with UCB1 eval equation that someeone clever already solved and it's in the video

Cegwe: yeah i saw that

Wontonimo: some people call it the "exploration term"

Wontonimo: it's the second half of the UCB1 evaluation

Wontonimo: the first half is just average reward

Cegwe: Man this is going to be a whole project for tomorrow

Cegwe: Maybe I'll try putting this into the counting tictactoe game although idk if that'd be worth it

ProCoder03: So Minimax is just MCTS, but instead of exploring the promising one, you explore all the possibilities. Am I right ??

Cegwe: I'll probably try it on something new

Wontonimo: it took me 4 weeks, 30 hours a week to write my UTTT bot. Maybe I'm slow. it was also the first time in over 25 years that I coded c++

Cegwe: Man that must be wild

Cegwe: Imma try to do it in java, it'll probably take me equally long if not longer

ProCoder03: well if you know Flat MC and basic trees, It was easy....

Wontonimo: 2 words : unit tests

ProCoder03: not too easy, took me 14 hrs to debug and make it work properly

Cegwe: I still have to figure out exactly whats going on with mcts anyways - you and that video definitely helped but i still feel miles away from true understanding

Wontonimo: i used bitboarding for uttt. it's a must if you are using MCTS

Cegwe: bitboarding?

Cegwe: oh gosh more stuff I've never heard of

Wontonimo: yeah, say you are just playing TTT, plain 3x3 TTT

Wontonimo: and you need to save the game board

Wontonimo: 2 players, 9 squares, 3 states per square

Wontonimo: how would you store that info?

Cegwe: array with 1 for x, 2 for o, 0 for empty, and then i'd do a seperate variable with whose turn it was

Cegwe: in a file it would probably look like aXEOEXEEEO

Cegwe: a being the first player(X), and E being empty

Cegwe: that's how id do it

Wontonimo: okay. now how we check to see if one player has just placed a move that wins, we would iterate over the horizontal, the vertical and the two diagonals

Wontonimo: right?

Cegwe: yeah

Wontonimo: 8 iterations, with 3 lookups into the array per iteration

Wontonimo: for 8x3 accesses of the array

Wontonimo: okay,

Wontonimo: what if instead

Wontonimo: we stored each players owned positions in 1 int, in the bytes of the int

Cegwe: how do you mean?

Wontonimo: so, if player 1 has no squares then we would store that as 1 int like so 0b000000000

Cegwe: oh ok

Wontonimo: and if that player owned the centre, then like so 0b000010000

Wontonimo: and we do the same for the other player

Cegwe: oh i get where this is going i think

Wontonimo: now, there are 512 possible configurations of 9 bits

Wontonimo: and you can make a table of which configurations are winning configurations

Wontonimo: and in ... wait for it ....

Wontonimo: ONE lookup you can know if the player won

Wontonimo: that's a lot faster than 8x3 in a loop

Cegwe: that's true

Wontonimo: it isn't 24x faster

Wontonimo: it is a lot more than that

Cegwe: can you use a seperate file to store those winning positions on this website? or would you have to messily leave that in the code somewhere?

Wontonimo: because the loop has a branch, and branches are actually pretty expensive

Wontonimo: you can calculate it once at the startup of your code and build the 512 values in 1 millisecond

Cegwe: oh i see

Cegwe: i didnt think about having the code do it

Cegwe: that makes a lot more sense

Wontonimo: for UTTT, my code uses 9 mini 3x3 boards. each mini 3x3 board uses the above technique

Wontonimo: another example of how this is a benefit ,

Wontonimo: say you want to calculate all remaining valid moves

Wontonimo: playerA has some value like 0b10010000

Wontonimo: and playerB has maybe 0b000010000

Wontonimo: the valid moves that remain is

Wontonimo: 0b111111111 ^ (playerA | playerB)

Wontonimo: in 2 operations you've calculated all the remaining valid positions

Wontonimo: I was slightly aware of this concept before UTTT, but I really didn't have a good appreciation of how much it optimizes code.

ProCoder03: Wontonimo: A small doubt, so Minimax is just MCTS, but instead of exploring the promising one, you explore all the possibilities. Am I right ??

ProCoder03: and one more, how do we sense the heading direction of Tron ??

Wontonimo: i guess. If the exploration constant in MCTS is high enough, it will act very much like Minimax.

Wontonimo: but probably not as efficient as minimax

ProCoder03: so Minimax is effective than MCTS, though a time consuming algo ??

Wontonimo: hmm ... there is a difference between MCTS and a UCT with eval. MCTS is a special case of UCT (upper confidence Tree) where the eval is a random playout.

TechnoBot: Hi :)

Wontonimo: you can sub in some other eval for a random playout, then MCTS becomes a UCT with eval. Minimax usually has an eval, so it is more like UCT

TechnoBot: ??????

Wontonimo: hi TechnoBot

TechnoBot: HI Wontonimo

ProCoder03: what's UCT ??

ProCoder03: is it like UCB1 ??

TechnoBot: Bruh

TechnoBot: NO ITS NOT

ProCoder03: then ??

TechnoBot: ITS not a UCB

Wontonimo: UCB1 is the equation for directing expansion

TechnoBot: Ill tell you after u play Coders Strike back

TechnoBot: what a UCT is

TechnoBot: JOIN

ProCoder03: I am already in gold in it

Wontonimo: you can use another equation, there are plenty. UCB1 is just the most famous atm

Wontonimo: what rank have you reached in CSB TechnoBot ?

ProCoder03: okay, but What is acronym of UCT ??

Wontonimo: Upper Confidence Tree

Wontonimo: that's the Tree part of MCTS

Wontonimo: MC = Monte Carlo, TS = Tree Search

ProCoder03: Which part, the rolling part ??

Wontonimo: the tree search is the UCT that is in MCTS

Wontonimo: the tree in MCTS is an UCT

Wontonimo: back to TechnoBot, what's your rank in Coders Strikes Back?

Wontonimo: have you implemented a PID controller?

TechnoBot: Hey lets see who can finish Coders Stroke Back First. Beat me and I'll tell you something You Don't Know

Cegwe: dangi t

Cegwe: my internet timed out

Cegwe: i hate this shitty internet but its the only decent provider around here

Wontonimo: okay, you are on TechnoBot

ProCoder03: well as per that guy in video, He told MCTS has 4 parts - Selection, Expansion, Rollout and Backpropagate, I implemented MCTS according to it... So can you point what part is UCT Wontonimo ??

Wontonimo: the whole tree. that thing you expand and select from

ProCoder03: The Tree which I select and expand is called UCT ah.. ??

Wontonimo: I'm a little ahead of you TechnoBot, try harder

Wontonimo: yeah ProCoder03, you got it!

TechnoBot: BRUH

ProCoder03: you call that little ahead humphh ??

Wontonimo: if you want I can push your pod at little faster

Wontonimo: but seriously TechnoBot, would you like a hint ?

TechnoBot: Nope.

Wontonimo: cool

TechnoBot: But I'm just gonna push it back a bit lol

TechnoBot: I'm gonna beat you at the last second or rather the last 0.1 sec

TechnoBot: :smirk:

TechnoBot: Done.

TechnoBot: I finished lol

TechnoBot: :D

Cegwe: yay my internet started working again

TechnoBot: Cegwe's internet is bad

TechnoBot: LOL

Cegwe: facts

SimonLandry: Ditch the wifi

SimonLandry: that might help

TechnoBot: Yeah

TechnoBot: My bot wifi is The BEST

TechnoBot: It has a password tho

Cegwe: you're right no more wifi

miszu: 57th in the 2048 optimization

miszu: yesss

TechnoBot: It's name is @GP_PH

Cegwe: I'll send my messages in the mail, please respond within 2 business weeks

Cegwe: Imma give 2048 a try

Wontonimo: congrats miszu !

TechnoBot: Wontinimo

Wontonimo: are you using a beam search?

TechnoBot: BRUH

Wontonimo: that's the second time you use that word. i don't think it means what you think it means

TechnoBot: I just finished

TechnoBot: LOL

TechnoBot: Are you still racing?

TechnoBot: HAHAHAHAHA Bruh man]

Wontonimo: ??

Wontonimo: miszu , are you using a beam search for 2048?

TechnoBot: did you finish

TechnoBot: CODERS STRKE BACK

TechnoBot: EH

TechnoBot: ?

ProCoder03: he isn't racing, but his bot is !!

Cegwe: oh gosh now i gotta look up what beam search is

Wontonimo: oh, i made a bot for coders strikes back, yeah

Cegwe: all this stuff and information

TechnoBot: Hey im the bot

TechnoBot: I am controlling my computer

TechnoBot: cause I am the computer

TechnoBot: HAHAHAHAHAH!!!!!!!!!

TechnoBot: BTW Wontinimo DID NOT MAKE ME

Wontonimo: beam search is very much like breath first search, except you only keep the last X number of promising items, and you expand the one that looks the most promising first

Cegwe: oh ok

TechnoBot: Bruh

TechnoBot: 𝓑𝓡𝓤𝓗

Cegwe: that was actually immediately understandable for once

ProCoder03: BFS and DFS are like MCTS ??

TechnoBot: 𝓑𝓡𝓤𝓗

TechnoBot: That is so easy

Cegwe: Imma try to implement my own version of that without looking anything up

TechnoBot: Hey Wontinimo, What place are you in the race

Wontonimo: no, bfs and dfs are not like mcts.

TechnoBot: WONTINIMO

TechnoBot: WHAT PLACE ARE YOU IN THE RACE

Wontonimo: 78th

TechnoBot: Ok,

Wontonimo: don't shout

eulerscheZahl: MCTS has some parallels with DFS: you fully expand a path to the end and then go back up

TechnoBot: Im 83th

TechnoBot: and

TechnoBot: a promise is a promise

eulerscheZahl: but you don't explore the other paths immediately. you don't even necessarily explore the whole tree

TechnoBot: Wontinimo

eulerscheZahl: and you are more careful when it comes to selecting the node you expand next

ProCoder03: :+1: eulerscheZahl

Wontonimo: i don't think we are in the same league TechnoBot

TechnoBot: Yeah

TechnoBot: cause im 90th

TechnoBot: :(

eulerscheZahl: are you at least in the same game?

ProCoder03: he is 88640th ig

TechnoBot: NO

ProCoder03: You are TechnoBot, execpt you are in Wood 2 while he is in Legend...

Wontonimo: according to the leaderboard you are 84,240th over all.

TechnoBot: FINE

TechnoBot: Bruh Im just an iMac

eulerscheZahl: close guess for a random number ProCoder03

eulerscheZahl: got 3 out of 5 digits right

TechnoBot: iMacs are dumb thats why I'm 84240th

TechnoBot: Cause I'm an iMac

ProCoder03: nahh... I saw his when he was at the last of leaderboard..

Wontonimo: try reloading the default code using the circle arrow in thee upper right hand corner TechnoBot (i'm not trolling)

ProCoder03: It was not a guess, it was his previous rank

Wontonimo: your current code is crashing your bot

TechnoBot: ok

TechnoBot: I think you mean Upper left corner

Wontonimo: the error message is that your code timed out. you probably have an if statement around your final print, and when it is false you don't print anything

Wontonimo: no, upper right, in the coding game IDE

TechnoBot: Beat me in ONBOARDING ok?

TechnoBot: Start in

TechnoBot: 9

Wontonimo: not the browsers reload

TechnoBot: 8

TechnoBot: 7

TechnoBot: 6

TechnoBot: Play

TechnoBot: ONBORDING

TechnoBot: Hey

ProCoder03: :wave:

TechnoBot: play Ultimate TIC TAC TOE

TechnoBot: beat me and ull tel u a secret

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

ProCoder03: Nah... you have to beat me..

TechnoBot: ok

TechnoBot: start now

ProCoder03: I am already in bronze...

TechnoBot: Its best If u dont know iMacs

TechnoBot: hehehe

TechnoBot: 99% of all plays I am in #1 place

**TechnoBot slaps ProCoder03 around a bit with a large fishbot

TechnoBot: HAHAHAHA

TechnoBot: But I should slap myself for taking a nap.

**TechnoBot slaps TecnoBot around a bit with a large fishbot

Wontonimo: hey TechnoBot, are you MK. you are acting a lot like an MK

Cegwe: does the seed in 2048 not work as shown in github? it doesnt seem to be following the same rules, but maybe that's just me

TechnoBot: Nope

TechnoBot: look at my rank

eulerscheZahl: the 2048 seed works just fine. the github code is the same as on CodinGame

eulerscheZahl: common mistake: swap x and y when enumerating possible cells to spawn at

jacek: happy Caturday

Cegwe: oh ok

Cegwe: illl take a look

eulerscheZahl: same to you jacek

TechnoBot: Hey

TechnoBot: What am I saying (type in chat)

Cegwe: I must've messed up somehow, my positions are indication all wacky

TechnoBot: hey

TechnoBot: tell me something

Wontonimo: i got to 32,768 on my phone in 2048 once. It took a few weeks.

TechnoBot: Look at the ranking

TechnoBot: What do you see?

Wontonimo: there is a pattern

Cegwe: yeah but i messed up reading the seed and im having trouble finding out why

ProCoder03: its a power of 2 iirc...

TechnoBot: The Boss took my profile pic an I took his

Wontonimo: i used the ref code. i didn't feel like fiddling with the seed generator.

Wontonimo: for 2048

TechnoBot: ?

TechnoBot: Im doing POWER OF THOR

Cegwe: ill try using the reference

jacek: oO

Wontonimo: episode 1 TechnoBot ?

Wontonimo: the referee. not reference

Wontonimo: is that bad? should I get a demerit point for that?

ProCoder03: for what ??

TechnoBot: HUH

Wontonimo: nvm, was asking Jacek

jacek: the oO was to reference

Wontonimo: +1

Wontonimo: i have to remember to recommend Thor episode 1 to new joiners. I forgot about it.

TechnoBot: BRUH

Cegwe: I copy pasted and it still isnt returning the right values

Cegwe: I feel like I might just be stupid

Cegwe: I'm just going to go to sleep and hopefully I'll figure things out tomorrow

Wontonimo: good luck

Wontonimo: i have the same feeling regularly while programming

Wontonimo: ng all

Wontonimo: i'm out also

TechnoBot: ok

**TechnoBot slaps Wontonimo around a bit with a large fishbot

TechnoBot: TECHNO BOT IS SHUTTING DOWN

TechnoBot: NETWORK FAILURE

TechnoBot: SELF DESTRUCTING IN

TechnoBot: 10

TechnoBot: 9

TechnoBot: 8

TechnoBot: 7

TechnoBot: 6

TechnoBot: 5

TechnoBot: 4

TechnoBot: 3

TechnoBot: 2

TechnoBot: 1

eulerscheZahl: no spamming please TechnoBot

jacek: oh, i made little mistake in clash of bots

jacek: fixed and 3 ranks up. not much but better

jacek: and who approved it :unamused: i found a bug https://www.codingame.com/replay/583804833

jacek: "If players have the same number of alive robots, the winner is the player with the most summary health." yet it was draw

eulerscheZahl: funny thing is that the endscreen even declares a winner

Default avatar.png DoubleOracle: when would the volcanoes puzzle count as solved for the puzzle of the week achievement?

jacek: when you reach next league

Default avatar.png DoubleOracle: to me it looks like the first boss plays random, so submitting the default code could work. Wil give it a try ;-)

jacek: oO

Default avatar.png DoubleOracle: it actually feels like it plays worse than random

Manjius: is R in codingame?

eulerscheZahl: Console.WriteLine("RANDOM") that's from the boss code

eulerscheZahl: there is no R here

Manjius: is R the son of something thats here?

eulerscheZahl: no

Manjius: oh well ty

eulerscheZahl: languages and versions: https://www.codingame.com/playgrounds/40701/help-center/languages-versions

Default avatar.png DJTenYearOldDictator_63b0: wazr

eulerscheZahl: the higher boss at volcanoes is surprisingly complex. MCTS with > 2000 lines of code

Default avatar.png DoubleOracle: is the code of the bosses public?

eulerscheZahl: but not really speed optimized

eulerscheZahl: no it's not public

jacek: then how do you know it :thinking:

eulerscheZahl: i found an undocumented way and reported it long ago

Default avatar.png DoubleOracle: did you report it publicly?

Default avatar.png DoubleOracle: I had to submit the random bot twice, but got promotion and quest completion :-)

eulerscheZahl: no public report but staff is aware

jacek: low priority eh

MiyamuraIzumi: hello guys

jacek: happy Caturday

MiyamuraIzumi: how to be a tech guru?

MiyamuraIzumi: too silent

eulerscheZahl: what is a tech guru?

MiyamuraIzumi: forget about it, just a stupid question

jacek: Oo

TheBlueBias: Start by being a kan guru.

MiyamuraIzumi: haha

Default avatar.png d33pb1ue: guys how do i do power calculations but faster

Default avatar.png d33pb1ue: because my program times out

eulerscheZahl: not sure if you ask the right question to get the answer you want

eulerscheZahl: do you want a power modulo something for instance?

Default avatar.png d33pb1ue: So I mean when doing a**b, but with bigger numbers like 2*13786 which takes too long

eulerscheZahl: and i'm pretty sure you don't even want the actual result

eulerscheZahl: just tell us what you really need

Default avatar.png d33pb1ue: What do you mean I don't want the actual result

eulerscheZahl: do you want to compute the power just to have it? or do something with it? maybe you can do the second without the first

Default avatar.png d33pb1ue: I want the first 3 digits of the result

eulerscheZahl: i see. sounds like you can compute a logarithm then

Default avatar.png d33pb1ue: What are logarithms?

eulerscheZahl: https://math.stackexchange.com/questions/89403/is-there-a-way-to-find-the-first-digits-of-a-number

Default avatar.png d33pb1ue: Thank you!

eulerscheZahl: the logarithm is a math function, you'll learn that in higher grades at school

eulerscheZahl: see it as an inverse of the exponential

Thyl: Who will do SnackDown ???

Default avatar.png Badea: Hi, I have a question, is there a way of obtaining all clash of code problem statements?

**TheBlueBias drop his Twix on the floor.

TheBlueBias: Done Thyl.

eulerscheZahl: do you want to solve them all in advance Badea? there are more than 1000 clashes

eulerscheZahl: I count 1415, but some of them are already removed now because of poor rating

Default avatar.png Badea: Yea I want to practice on them, maybe translate them in my language for those who are not so good with english.

MiyamuraIzumi: How to have a girl friend?

jacek: not on this website

TheBlueBias: Code one

MiyamuraIzumi: haha

MiyamuraIzumi: how do I start to code a girl friend?

MiyamuraIzumi: google doesn't have the answer for this

Default avatar.png thealmightyjason: thats pathetic

TheBlueBias: An over-complicated opening book would be a godd start.

TheBlueBias: *good

MiyamuraIzumi: can opening book be randomness

MiyamuraIzumi: she should be interactive and randomness

MiyamuraIzumi: still which algorithm should I use?

Default avatar.png DoubleOracle: is it actually possible to create a whitelist or blacklist to filter chat?

struct: DoubleOracle you can put ?disableChat

struct: to the end of the url

struct: or do you mean block someone in the chat?

Default avatar.png DoubleOracle: Thanks for the tip - I was more thinking about filtering really than disabling

Default avatar.png DoubleOracle: could be users, keywords

Default avatar.png DoubleOracle: But I guess I could do that on discord?

struct: yeah you cant do that here

struct: No idea if you can do it on discord

Default avatar.png DoubleOracle: I was somehow assuming that the world chat is mirrored on discord - but I don't find the corresponding channel

Default avatar.png DoubleOracle: So I assume it is not mirrored?

eulerscheZahl: completely different chats

eulerscheZahl: this one is older than discord

Default avatar.png DoubleOracle: I see

Default avatar.png DoubleOracle: thanks for clarifying

ProCoder03: will this work num&1^1 if I want to check if num is even or not ??

ProCoder03: and will it be the fastest way to check if something is even or not ??

antiwonto: num&1

struct: n&1 yes

jacek: its faster https://www.npmjs.com/package/is-even

eulerscheZahl: dependencies: 1 (is-odd)

ProCoder03: :laughing: I just saw it now, using is-odd for is-even

HARRYPOTTERFANATIC: 😆

eulerscheZahl: over-engineered code, as I only wrote it for homework at programming classes

eulerscheZahl: there is also this package: https://www.npmjs.com/package/is-zero

jacek: but no dependencies

jacek: isPositiveZero mhm

eulerscheZahl: when you look at the code, it even does something

eulerscheZahl: https://github.com/i-voted-for-trump/is-odd/blob/master/test.js

eulerscheZahl: wait, wrong link

jacek: i-voted-for-trump

eulerscheZahl: that username

eulerscheZahl: https://github.com/mohayonao/is-zero/blob/master/index.js that's what I wanted to link

jacek: https://www.npmjs.com/package/is-zero

jacek: argh https://www.npmjs.com/package/is-ten-thousand

eulerscheZahl: of course someone who thinks it's a good idea to release an is-odd package also votes for Trump. makes total sense

jacek: and its dependencies

jacek: finally something worthy for discord memes

eulerscheZahl: https://github.com/james-work-account/is-ten-thousand/blob/main/index.js what a troll code

MiyamuraIzumi: so I see why it need a package now

eulerscheZahl: maybe some see it as a way to tell "see what I did". like having a commit in the Linux kernel

jacek: or having clash played

Thyl: In a minimax, If i explore at depth 9 a branch and 4 antother, the 9 branch is sure

jacek: hm?

AntiSquid: maybe you refer to alpha beta pruning thyl, but not sure what you try to say

Thyl: I want to cut a branc if it get a lot of time

jacek: iterative deepening?

Thyl: jacek is it aproximally

eulerscheZahl: sounds a bit like A*

eulerscheZahl: there you also have some paths that are more explored than others

Thyl: no

eulerscheZahl: yes

Thyl: if in the exploration the time for the exploration is big stop the search

eulerscheZahl: is there are reason not to use iterative deepening then?

Thyl: yes

Thyl: the complexity of Iterative deepening is O (n+n+1+n+2+n+3...)

Thyl: with my code it will be in theory :P

Thyl: O(N)

Default avatar.png tangugu: Where can I see the answer

jacek: umm complexity of iterative deepening is still O of the original search

Thyl: eulerscheZahl do you understand

Thyl: ???

eulerscheZahl: sorry, had a private message about 2048 simulation open

Thyl: jacek

eulerscheZahl: look how the tree explodes. even if you only have 2 moves each turn, the node size always doubles

Thyl: yes

eulerscheZahl: of course you do double work with iterative deepening. but it's really minor, wasting a few milliseconds when the next layer can easily take a second

Thyl: ok

Thyl: thx!

eulerscheZahl: add alpha-beta if you haven't already. that one is a big game-changer. combine with some move ordering if possible

Thyl: I did it

Thyl: in oware I am ~ 28

Thyl: I searchto optimize

eulerscheZahl: i'm at 27 :P

Thyl: Yes

Thyl: I know

eulerscheZahl: i had to look it up

Thyl: but you have a MCTS

eulerscheZahl: i think i have a minimax too

Thyl: ooo

Thyl: I kinow

Thyl: When my last Iterative deepening work

eulerscheZahl: yes, negamax with iterative deepening and alpha-beta pruning

Thyl: eulerscheZahl with an old code :

Thyl: 5 minutes to read

Thyl: And He know the code function ;)

Thyl: GG !

Thyl: negamax is the same of minimax

Thyl: ???

eulerscheZahl: yes, just a different way to implement it

TheBlueBias: Just code optimization.

TheBlueBias: You can try to add killermoves in your ID Thyl.

eulerscheZahl: looking at my code, I didn't really try to optimize anything

eulerscheZahl: 237 lines, mostly reused from my checkers bot. and a slow simulation

struct: Optimization is not worth

eulerscheZahl: copying the state array at each expansion step

Thyl: with my minimax sometimes with ID I go to depth 14

eulerscheZahl: i get somewhere in the range of 150k-200k nodes that I visit

jacek: my 'depth' isnt comparable as i use best-first rather than brute-forcing

jacek: do you have smart eval?

eulerscheZahl: is that some special vocabulary I should know?

jacek: i bet its from http://www.joansala.com/auale/strategy/en/

eulerscheZahl: found a scoring on some website, fail to find it again

eulerscheZahl: yes, that's it :D

HARRYPOTTERFANATIC: Hello

Thyl: I think I have a stuck eval

Thyl: I want to implement a hash function

Thyl: a or an hash funtion ???

Default avatar.png JData31: "a"

Thyl: sorry french accent

Default avatar.png JData31: Wee

Thyl: in french H isn't speak

TheBlueBias: Parmentier is a good hash.

Scarfield: in french you dont pronounce "s" as last letter right? so "hash" would just be "a"?

Thyl: yes

TheBlueBias: No

Scarfield: xD

TheBlueBias: sh is pronounced...

Thyl: it's the same hash or ash

TheBlueBias: Scashfield

Scarfield: LeBlueBia

Thyl: yes

jacek: i live in spain. the s is silent

Scarfield: lol

Thyl: jacek

Thyl: las niños

Thyl: s is present

Thyl: I have Spanish to my school

TheBlueBias: i eñor

jacek: uhm

jacek: carfield, explain the joke to him

Scarfield: spain - s

Thyl: oooo

Scarfield: :)

Thyl: ok I understand

Thyl: I have 2 years of english

Thyl: don't joke with the letters :D

Thyl: and is los niños sorry

eulerscheZahl: you only started to learn English 2 years ago?

Thyl: Yes

eulerscheZahl: then you are doing astonishingly well

Scarfield: +1

Thyl: Thx

Scarfield: 2 year old english children cant even spell

TheBlueBias: :no_mouth:

Thyl: I ahve 13 years old,

Thyl: I have two years of ENglish

Thyl: ;)

jacek: in basement?

jacek: :scream:

Thyl: no

HARRYPOTTERFANATIC: Hello

TheBlueBias: All your basement are belong to us!

Thyl: I'm 13 years old

Thyl: I'm so tired And in Frecnh is ~ "I have 13 years old"

Thyl: in the idea

Thyl: eulerscheZahl now 27 is me

Thyl: :)

eulerscheZahl: i'm not 27, already reached the 30 :older_man:

eulerscheZahl: from now on it's only going downhill

Thyl: I have a hasher function

HARRYPOTTERFANATIC: Hello, Bonjour, Ciao

jacek: :tada:

Thyl: but I don't know if it's a good hash function

Thyl: https://codeshare.io/lokOwg

TheBlueBias: HARRYPOTTERFANATIC I think your time turner is broken.

Thyl: eulerscheZahl Will you do the Fall CHallenge ?

TheBlueBias: ...

HARRYPOTTERFANATIC: TheBlueBias Lol

HARRYPOTTERFANATIC: Maybe

eulerscheZahl: no, i'll pass on the next contest

eulerscheZahl: the first since The Accountant in 2016 that I'm missing

jacek: oO

TheBlueBias: You're not going to participate to spring challenge 2022?

eulerscheZahl: depends on the type of contest

Thyl: A codechef contest ??? :P

eulerscheZahl: i have some contests lined up to play

eulerscheZahl: Kotlin heroes on Oct 7th

jacek: :ketchup:

eulerscheZahl: then 2021 ICPC Communication Routing Challenge: Marathon (oct 9th-12th)

eulerscheZahl: Reply Cybersecurity Challenge 2021 Oct 15th

eulerscheZahl: on the 13th topcoder hosts a marathon for 7 days but collides with Reply :(

eulerscheZahl: they finally messaged me to claim my tshirt from TCO 2021

Thyl: Do you have a great ranking in contest for the same of TopCoder

Thyl: ???

eulerscheZahl: i'm not that good on topcoder

eulerscheZahl: they have those short rounds (2-3h contests) where i'm horrible

TheBlueBias: eulerscheZahl can you sahre the links for reply and topcoder?

eulerscheZahl: and the marathons (7days+) were i'm somewhat ok

eulerscheZahl: it's both on clist

eulerscheZahl: marathon will show up here:

eulerscheZahl: https://www.topcoder.com/challenges?bucket=openForRegistration&tracks[DS]=true&types[]=CH&types[]=F2F

eulerscheZahl: (copy the whole thing, chat fails to detect the link)

TheBlueBias: Oh right. I forgot this...

eulerscheZahl: https://challenges.reply.com/tamtamy/challenge/75/detail

TheBlueBias: Thx

eulerscheZahl: it's a team event. 24h for 25 tasks

eulerscheZahl: team of 2-4

TheBlueBias: Erf.

eulerscheZahl: tasks are about coding, crypto, some web related stuff

eulerscheZahl: 5 tasks per category

jacek: i finally learned to use struct instead of class with all public things

eulerscheZahl: last year I mostly managed to solve the coding part

eulerscheZahl: Tobou will be happy to hear that

jacek: hm?

eulerscheZahl: using struct...

jacek: mhm

darthinvader666: yo

HARRYPOTTERFANATIC: Hello

SandmanSW96: hey all

HARRYPOTTERFANATIC: Hi

SandmanSW96: hey euler, is there a suggestion box page here?

jacek: go to /dev/null

SandmanSW96: the url?

eulerscheZahl: forum I would say what do you want to suggest

jacek: hmmm ok...

jacek: or discord

eulerscheZahl: maybe it has been suggested before and was refused or will be done eventually

SandmanSW96: oh yeah the forum i can look, but i was thinking,

SandmanSW96: what if commented characters weren't counted in clash of code golfing?

SandmanSW96: I use c# and still try, i know i will lose lol but its good practice to learn short hand, so, since i am almost guaranteed to lose lol,

eulerscheZahl: unlike to happen. one just does not write comments in golf

SandmanSW96: i dont shorten my code into one line, i try to break it up into each section

jacek: or use c# for golf...

SandmanSW96: i can just eat the extra chars,

eulerscheZahl: it's also not as trivial as you might think

SandmanSW96: but i break up my code into segments,

SandmanSW96: and i would like to label them for anyone to see what they do

eulerscheZahl: x=2; // \u000A x=3; System.out.println(x);

eulerscheZahl: what does this print?

SandmanSW96: 2

eulerscheZahl: in Java

SandmanSW96: er 3

eulerscheZahl: yes it's 3

eulerscheZahl: that unicode \u000A is a newline

eulerscheZahl: and the compiler replaces this first before applying the comment

SandmanSW96: yeah i was trying to figure out that heiroglyphic

SandmanSW96: but thanks though, i'll just eat the extra chars, my clash points are always close to max anyways lol

eulerscheZahl: c# just isn't the right language for golf (will get better with C#9)

jacek: 2 1 7 3...

jacek: or 2137? :thinking:

eulerscheZahl: 2.718

Default avatar.png Mehmetvv: hello?_

jacek: hi!

olaf_surgut: the next fall challange will be the coding escape room?

olaf_surgut: what a surprise

jacek: oO

jacek: open the door, get on the floor, everypony walk the dinosaur ~

TheBlueBias: Can I have some?

CodeKing45: hey guys I got a question about the temperatures exercise? the directions are vague or at least seem to be. am I supposed to answer only in console.log or do i have to set up an "if" iterator first?

jacek: write answer into console.log

TheBlueBias: You're supposed to output the good answer. You can do what you want with the default code. Even delete it and write yours.

CodeKing45: ah thanks

CodeKing45: one more question. by playing with the console only what is this supposed to teach me/

TheBlueBias: Console only ?

jacek: you can interact with the puzzle only with i/o (take input, print output to console)

jacek: some puzzle can have nice visuals

jacek: coming from javascript world, using console only seems unnatural eh

CodeKing45: can i play with n?

jacek: n?

jacek: oh, temperatures. this is number of temperatures provided by puzzle's test case. dunno what you mean by playing with it

CodeKing45: oh i see now. its a function

CodeKing45: nevermind

SandroB07: https://escape.codingame.com/game-session/kKu-jBA-Gpj-5d2

SandroB07: https://escape.codingame.com/game-session/kKu-jBA-Gpj-5d2

jacek: :scream:

Uljahn: SandroB07: pls don't spam invites here

Default avatar.png GruelingPine185: hi

miszu: hey all, I reached 57th in the 2048 optimization. I am hitting a bottleneck in my optimization as I don't know where should I improve. Anyone willing to discuss in DM?

jacek: nice

miszu: seed = seed * seed % 50515093L;

why this line works well in IDE but in visual studio it gives me negative value as if it was an overflow?

jacek: is seed int64_t?

miszu: it is a long

miszu: in both places

jacek: try long long

miszu: jacek jestes geniuszem!

miszu: it works

TheBlueBias: 32bits PC ?

miszu: 64 bits

jacek: personally i use int64_t uint64_t etc.

miszu: but I guess there is a default thingy in visual studio

jacek: long is at least 32bit, not always 64

TheBlueBias: True. But in modern architecture it's generaly the case...

TheBlueBias: MS... :smirk:

miszu: I find it sad that my code online has a better score than offline if I let it run until reaching best state... I am using beam search in both cases

struct: well sometimes a bad move may end up being good

miszu: I am using 4100 as beam size so you can see 6 moves ahead

struct: are you using nth_element?

miszu: also not sure if my heuristic is ideal

miszu: so I sort my open list based on heuristic then select 4100 best nodes

struct: you use sort or nth_element?

miszu: sort yes

struct: nth_element will be faster in this case

miszu: sort(open_list.begin(), open_list.end(), high_score_key()); // sort by best score.

           vector<Beam_Node>::iterator begin = open_list.begin();
           vector<Beam_Node>::iterator end = open_list.begin() + min(BEAM_SIZE, (int) open_list.size());
           vector<Beam_Node> beam_list(begin, end);

miszu: I will check nth element

struct: http://chat.codingame.com/pastebin/5fa2cc35-ef36-4041-9ef7-54eea84cf511

CodeKing45: what math is temperatures using? i change i in let =... and i get random integers but always the same. i log -10 and it comes out 6 instead of 5 for example

struct: miszu also msvc sort might be different from gcc

CodeKing45: console.log(n)

CodeKing45: let i = -10

CodeKing45: what math is this thing using.

jacek: the normal math :v

CodeKing45: the only test that worked so far is zero

miszu: ok I will try nth element

miszu: also, when taking n elements, do you take by best score or by lowest # of turns?

CodeKing45: i am just trying everything to see what works. so far the only one that works is 0 for let i = 0

jacek: do you understand how loops work?

CodeKing45: yes. what I don't understand is how it is being calculated or iterated

CodeKing45: how THIS is being calculated

darkhorse64: miszu, if you're doing bs, each node has the same # of turns

CodeKing45: nevermind. I will solve this on my own

Astrobytes: CodeKing45: post your code, easier to help you

CodeKing45: this is the code that works

CodeKing45: http://chat.codingame.com/pastebin/cedc4c9b-ba45-4e33-bee7-9708a9350665

CodeKing45: http://chat.codingame.com/pastebin/d2f31a21-c87c-4649-b18a-1c0117d73cc2

miszu: darkhorse64 yeah using beam search

miszu: so sorting by heuristic is fine when chosing n beams?

Astrobytes: CodeKing45: it auto pastebins

darkhorse64: yep, this is also what I do for 2048 but I hit a barrier

darkhorse64: Can really explain why but I see long before the end that I am not going to score more than 25M. If you look at the lb, there is a huge gap

jacek: Oups An error occurred (#314): "Submitted code is too big".

jacek: $#@$@#$@#$!!!!

Astrobytes: Fix your compression

Uljahn: import lzma [solved]

miszu: anyone who implements beam search, do you use two arrays (one for open and other for the beam) or you are able to do all in one array?

KINGOFBIGBOIMEME: SUS

Default avatar.png Jess316: @LemonZ can you explain this to me I am new here

LemonZ: explain what?

KingZumbie: hello

KingZumbie: bruh I am doing the descent but keep crashing on stronger mountains 1

KingZumbie: I think I found the solution

KingZumbie: I have to hit 1 two times or three

KingZumbie: Yup I cleared it

KingZumbie: Used this code to do it

KingZumbie: http://chat.codingame.com/pastebin/884720d1-4bd0-4d94-8cb0-db57cc21c03b

KingZumbie: simple print function

Wontonimo: hey

KingZumbie: hi

Wontonimo: you can't solve it that way because the validation test has the hills in a different location

Wontonimo: you need to write code to *find* the highest value and print it

KingZumbie: I just let the course run and whichever mountains the ship crashed on I putted in the print function for that number of index

Wontonimo: yeah, that's not going to solve the problem

KingZumbie: Well Id oit my way

KingZumbie: I do it*

KingZumbie: I ain't planning to work on some big project for the public coding is just a hooby for me

KingZumbie: hobby*

Wontonimo: how is your way going to pass ALL test cases?

KingZumbie: Bruv I ain't planning on doing all of them

Wontonimo: bruh

KingZumbie: And I learned more HTMl and CSS rather then a other coding language

KingZumbie: why do you think my way is not so good :/

Wontonimo: look at this code

Wontonimo: http://chat.codingame.com/pastebin/a01c46f5-8e62-4465-9e0e-35d8b90a5233

Wontonimo: it works for ALL the test cases

Wontonimo: it doesn't have the answer hard coded. it does what a program should do, which is calculate things for you and automate things.

TheBlueBias: Yeah! GG Wontonimo! You shared the solution!

Wontonimo: I think I won't get banned for this one

Wontonimo: maybe scolded, but not banned. (hoping)

eulerscheZahl: BAN!

Wontonimo: (tears of something)

Wontonimo: :wave:

eulerscheZahl: https://www.codingame.com/contribute/view/7415a2625a37d9f38e79f609ad77244e7a88 an extremely easy puzzle. but not even a bad one

TheBlueBias: Yeah! Let's share solutions! We don't care to

Wontonimo: hey TheBlueBias, I haven't seen you before

eulerscheZahl: it's BlaiseEbuth

Wontonimo: ah

Wontonimo: so many alt accounts ...

TheBlueBias: Lier. :neutral_face:

Wontonimo: mine is pretty obvious, antiwonto

TheBlueBias: That's not an alt

Wontonimo: it's a test account

TheBlueBias: neither

Wontonimo: don't do much with it other than look at the beginning of a multi that I no longer have access to

Wontonimo: that's a pretty cool contribution Olivier made

eulerscheZahl: idea for a part 2: don't give the user clear rules (red=bad), only tell after each event by changing a score. so the player has to understand the rules in code