Chat:World/2021-06-05
francisdbillones: is the test case wrong?
francisdbillones: I think the test case is wrong.
dbdr: 99.9% of the time, when people say that, the test is not wrong
francisdbillones: I am using a kinematic equation to solve this, and it is most certainly correct.
dbdr: what are you solving?
dbdr: this is a general chat
francisdbillones: What do you mean?
francisdbillones: Ah, how do I share the question?
dbdr: is it a clash?
francisdbillones: Is it okay with you if I simply paste the statement?
dbdr: sure
francisdbillones: A rocket is launched at the speed of 1 m/s and has a constant acceleration of 2 m/s^2. Wich means that every seconds, its speed increase by 2 m/s. This rocket reaches its goal in n seconds. Print the distance (in m) traveled by the rocket.
dbdr: not promising anything. but at least we'll know what this is about :)
francisdbillones: The kinematic equation I used to solve this is distance = v_0 * t + (1/2)*a*t^2
francisdbillones: is the initial velocity is simply 1 we can simplify this to distance = t + (1/2) * a * t^2
francisdbillones: as the acceleration is 2 we can get rid of the fraction
francisdbillones: distance = t + t^2
francisdbillones: But reverse engineering the given test case, they are expecting t^2 only
francisdbillones: Perhaps the problem statement is wrong, and the initial velocity was 0.
dbdr: this is https://www.codingame.com/contribute/view/62194d9a31d1f7c16f2b29cc7f62fc6214c4
dbdr: yeah, it's not well formulated
francisdbillones: Ah, they misled me with the "constant acceleration".
dbdr: "Wich means that every seconds, its speed increase by 2 m/s."
francisdbillones: Turns out it's discrete and not continuous, rendering the equation wrong
francisdbillones: Thanks for the clarification!
dbdr: indeed
dbdr: sure
dbdr: strange, the contribution cannot be edited
jacek: happy Caturday
aCat: happy ^^
Marchete: happy caturday :smiley_cat:
emh: meow
StevensGino: Hi all
StevensGino: does any have the code of mars-lander?
StevensGino: It seems like bug to me for the numbers output by the game
StevensGino: so I want to check how it is implement?
jacek: there no referee?
StevensGino: it is optimazation
StevensGino: so no referee
MACKEYTH: The lander engine tracks everything in floating point, but only reports integers
StevensGino: yeah, I just think about this
StevensGino: thanks, let me try again
MACKEYTH: I'm not sure how things are rounded, or if everything is rounded the same way
StevensGino: thank you
StevensGino: I don't see, in the description anything about game tracking in float :(
jacek: try discussions
MACKEYTH: I don't think it does say anything about it in the desc. I have found that kinematic equations produce accurate results over many turns, allowing for rounding the initial figures.
StevensGino: Oh, I just retest with everything in floating point, It works :D
StevensGino: so we might playing the game by ignoring all the input after turn 1 :(
MACKEYTH: Give it a shot :)
jacek: thats normal for games. ignore the input (or just print it) and see if your simulation matches
StevensGino: it just weird to me, for other games, I often try to make my code adapt/rounding so I can find the input of next turn
StevensGino: but everything have 1st time, I think
Chinnuvrs: I am having a problem with Coders Strike back can anyone explain to me the 180 degree
TobiasA: oi
dbdr: sure, but not with floats
MSmits: nah, but isnt inf always just some large number
MSmits: you can just halve that :)
dbdr: floats have real infinities
MSmits: oh really... well dont do that :P
dbdr: and -INF/2 == -INF
MSmits: i see
MSmits: did not know
MSmits: i usually just have minus 16k or something
dbdr: https://floating-point-gui.de/
MSmits: big enough that nothing else competes
dbdr: rabbit hole ;)
jacek: eh whatever floats your goat
MSmits: goat?
MSmits: last I checked poland is not landlocked :P
dbdr: https://goat-simulator.com/
MSmits: I own that game actually :P
MSmits: lol ofc there is a meme
dbdr: floats your bot?
MSmits: works
MSmits: mmh was discussing hashing for mcts last night, now i want to try it for C4
MSmits: seems in late game branching is very small, hashing states might be worth it
dbdr: in late game the game is over, no? I guess you mean just before that
geppoz: dbdr where did you get that quote from?
MSmits: i mean late game in the tree
MSmits: could be just after midgame in reality
dbdr: geppoz https://dke.maastrichtuniversity.nl/m.winands/documents/uctloa.pdf
dbdr: right
geppoz: ty
MSmits: could maybe do on expansion: if depth > 30 or something
jacek: that paper :scream:
MSmits: and then use TT
MSmits: whatever you do, dont use the pseudo code
dbdr: is it bad jacek>
MSmits: just the ideas geppoz :)
dbdr: ?
MSmits: the ideas are good
jacek: pseudocode is meh and too many pages for something that can be described in 2 sentences
geppoz: (there is some messy with pages? numbered to 36 but only 12? that is an extract?)
jacek: maybe its from journal
dbdr: starts at 25
jacek: anyway, wheneve i say im using vanilla mcts, the mcts solver is implied
jacek: or rather, it is not nn one
MSmits: btw, it seems to me that if you use a NN you can also do some heavy expansion pruning (based on logic)
MSmits: I do a very heavy rollout in uttt, but it's all safe pruning. It is very expensive though, but with NN that is negligible
MSmits: heavy expansion that is
MSmits: you could make your bot solve better if you did this too
MSmits: things like, don't consider moves that if you make them give your opponent the opportunity to finish 3 in a row on some row of boards
MSmits: dont expand those... then you dont have to run them through your nn
MSmits: maybe you already do, i dont know
geppoz: well, I think I will first try a "normal" MCTS, then this solver...
jacek: maybe
MSmits: thats a good idea, the same kind of sign bugs you get with mcts, also happen with solver
struct: yeah its a better idea
struct: its what I did
struct: solver was pretty simple after mcts was working
MSmits: jacek, not sure how it is with you, but reCurs e's uttt NN, last time i checked, sometimes makes poor choices in the very late game, because solving is hard for NN's
MSmits: too few rollouts
MSmits: so its opponents play perfectly, but the nn can't, it can just play very well, but occasionally makes a mistake
MSmits: recurs e also had this problem with othello
MSmits: anyway, so i think anything that may help you solve 1 or 2 plies sooner, might make it stronger
jacek: yeah, my most recent increase in strength comes from the fact i nearly doubled the rollouts
MSmits: cool, though that may just as well have something to do with performance earlier in the game ofc
MSmits: doesnt have to be the solving
MSmits: though with twice the rollouts it will definitely solve sooner
MSmits: this is also why i think you should go and code a oware endgame book and beat robo with it :P
MSmits: I think it's sad only tric trac seems to use it. Endgame books are fun
Butanium: I don't know if you saw but my first version of my MCTS for connect 4 reached rank 22 MSmits :)
jacek: :tada:
MSmits: oh, gj Butanium
MSmits: then it works. Mcts is all or nothing
Butanium: thanks !
Butanium: I'll try to add some eval before the end of the game
MSmits: oh
MSmits: how?
MSmits: like early playout termination?
Butanium: like depth for rollout max 10 or 20
Butanium: yes
MSmits: havent tried that for C4
MSmits: normally i do use that
darkhorse64: msmits: i saw you resubmit. "Grimoire" version or spam push ?
Butanium: For now I'm building my local version of the Connect 4
Butanium: so that I can test my different AI against each other
MSmits: this has grimoire, I wanted to test the unicode compression
MSmits: it's Chinese now
Butanium: What did you do which is specific to C4 MSmits?
MSmits: avoid losing moves in the rollout
MSmits: i mean thats not specific to C4, but the implementation is
MSmits: so dont playa move, if the opponent can then win the game on next turn
Butanium: just in rollout ? Don't you expend your tree with this condition too?
MSmits: yeah i do
Butanium: Ok that was what I planned too
MSmits: just be careful that you need a check before outputting a final move
MSmits: your root might not have children :)
darkhorse64: I have a good score against it. The previous grimoire had better spells
Butanium: ahah yes
MSmits: lol darkhorse64, thats the risk of using it.
MSmits: it becomes deterministic, like those NN's
Butanium: whay is this "grimoire" ? :eyes:
MSmits: opening book
Butanium: ok
MSmits: hardcoded moves
Butanium: I guess you generate them from some experimentations?
MSmits: current has 9974 moves. a lot less, meta mcts switched branches somewhere
MSmits: Butanium yes locally
Butanium: how do you do that exactly ? You make stats from a lot of game?
MSmits: I play a meta mcts that, instead of a random rollout, plays a game
MSmits: like the ones you play on CG
MSmits: then i backprop the stats
struct: how many nodes do you have in total?
MSmits: sec
MSmits: aw crap i cant even select my forms output, its refreshing to fast, lemme make a screenshot
Butanium: what do you mean by "plays a game like the ones you play on CG"
MSmits: same calc time more or less, per turn
jacek: instead of random simulation, you run another mcts
jacek: this simulation is more accurate then
MSmits: https://imgur.com/a/Xk0Vhd3
MSmits: ignore the fact that move 1 says 56%, it's majorly skewed because of that dangerous draw solve thing we discussed earlier
MSmits: it should be 50%
MSmits: I fixed it just now by checking for available drawn choices on backprop, but takes a long time to get back to 50%
dbdr: ah ok, was making me think it's a P2 win with steal
MSmits: yeah, no, somewhere at ply 14 i have a solved draw and it keeps selecting the lost siblings because they arent solved
dbdr: I mean the solved value
MSmits: ohh
MSmits: status = 2 means ongoing
dbdr: yeah, in the metamcts, you can certainly make the search "expensive" without consequences
MSmits: yeah thats nice, in some games you can go nuts with transpositions
MSmits: in uttt, i consider many boards that look completely different as identical
MSmits: won miniboards by different rows and such
MSmits: this way i can compress the state to below 128 bit as well
MSmits: very expensive to do, but as you say, no consequences
struct: thats on meta right?
MSmits: yes
MSmits: in uttt, you can describe a miniboard with a number between 0 and 8629
MSmits: which is less than half what you would get with ternary representation
MSmits: and around 15 times less than binary
MSmits: in a live bot thats nuts though
MSmits: and then of course you can rotate, mirror stuff as well
MSmits: 8629^9 < 128 bit
struct: crazy stuff
MSmits: yeah, I plan to write a tech.io article about these 3 systems for uttt
MSmits: noone else seems to use anything other than binary. I think Robo did ternary for while
dbdr: I think I use ternary
MSmits: oh cool
MSmits: for lookups then
MSmits: to lookup miniboard eval
MSmits: precalculated, right?
dbdr: yes
MSmits: i did that before as well, i managed a minimax bot that got to top 20 or so
MSmits: but c++, so your eval is better
IvesL: would it be great if we can create a competition based on connect 4 but in 3D
Nerchio: how do you organize c4 in bits when you can't fit that + a free row into 64 bits?
MSmits: why do you need a free row?
Nerchio: for victory checks
MSmits: oh you're using one of those examples for 6 x 7?
Nerchio: i think
MSmits: I did not use those
Nerchio: well i am not using anything yet
Nerchio: :D
MSmits: ohh ok
Nerchio: just seeing how it can be done
MSmits: well I check with simd in 4 directions at once
MSmits: but could be looped i suppose
Nerchio: what is simd?
MSmits: avx
MSmits: using a big register to do multiple operations at the same time
MSmits: 256 bit, so 4 x 64 bit
kovi: i was out of the loop you guys mean that solving draw makes more bad than good?
MSmits: 4 directions
MSmits: kovi no not necessarily, but it can lead to some bias. Doesnt have to affect winrate
MSmits: just try it i would say
MSmits: the problem is when you do selection and you have a choice between solved draws and other unfinished children, you might be selecting losses over and over
MSmits: but generally draws solve very late, so this doesnt have to be a big issue
MSmits: and you can experiment with ways to fix this problem. There's many approaches I guess
kovi: thx
MSmits: I usually just ignore it, but it was skewing my meta mcts, so i just fixed it
jrke: so c4is also getting popular like D&B
MSmits: puzzle of the week helps :)
jrke: yeah
MSmits: kovi, just coded the mcts hash thingy for c4
MSmits: testing it now, not seeing much difference
MSmits: running games vs robo in IDE, to see what ply it solves at
JaguarTordu: ?
darkhorse64: MSmits: is your simd wincheck faster than the scalar one ? I wrote a private playground to check my implementation and my scalar is 4x faster
MSmits: I dont know. I would have to write a scalar one
MSmits: let me see if thats hard to do
darkhorse64: I can give you mine
struct: thats a bit strange darkhorse64
MSmits: please do darkhorse64
MSmits: i hope it fits into my bot
darkhorse64: This is why I ask the question: you can conclude I suck badly
MSmits: does your winningmoves thingy give a bitboard with bits set where winning moves are?
MSmits: thats what mine does
struct: the slower operation should be setting the values of the register
struct: on ttt it was worth
RandomVariable: Hi, once activation, where can I disable the automated sharing of the solution of a puzzle ?
aCat: your settings
aCat: avatar + menu right top -> settings
aCat: and the bottom
Westicles: it that zeno in disguise?
aCat: auto publish solutions
aCat: I assume this is what you were looking for
-oa-: hi wewewewe
RandomVariable: thanks @aCat I just discoveredthat there are 2 settings. - the one you mentionned, in guess the main one - the one on the left, I guess only for code
m4chei: Is there any trick to win clash of code - shortest mode with JS against python? ^^
Westicles: submit immediately and hope they can't figure it out either
struct: im sure js can beat python is some clashes
KiwiTae: struct some with regex for sure
struct: (r=readline)(r()).split` `
struct: that calls readline 2 times
struct: and then splits the 2nd call
KiwiTae: u can do shorter in py
struct: sure
m4chei: i mean even logging the result in js is painfully long
struct: you can do print()
KiwiTae: ya
KiwiTae: its ok bud
struct: on ruby i can do `dd`
Westicles: can I have her phone number?
KiwiTae: Westicles wrong chat ~
1rre: I might completely rewrite my UTTT bot, currently I've got something which 1st looks for a move which meets certain conditions, then has about 10 fallbacks (none of which actually include the big board because idk, my backend would support it but I can't be bothered filtering the moves), but I feel like a scoring system would be better
1rre: "bad code": http://chat.codingame.com/pastebin/db735c75-3349-414d-afc4-1ba5c65f62ea
Nothing_just_Kuuhaku: http://chat.codingame.com/pastebin/76eef146-f6cd-4c01-ae15-907a728340f6
Nothing_just_Kuuhaku: Help me with my code in Coding Strike Back (cuz I'm quite new)
Nothing_just_Kuuhaku: Also this is my bad code: https://pastebin.com/WAKLE4ET
StevensGino: Hi guys
StevensGino: I am trying to optimal Marlander by GA
StevensGino: but I am not quite sure which should be the evaluation function?
sprkrd: could you imagine if the NASA guys implemented GA to guide their rover? It would be outrageous :joy:
sprkrd: StevensGino There's an article in the blog, have you checked that?
StevensGino: you mean this : https://www.codingame.com/blog/genetic-algorithm-mars-lander/
StevensGino: sprkrd?
sprkrd: yeah, that one
sprkrd: haven't read it in depth, doesn't it say which fitness function they use?
StevensGino: ok, I just don't know if there are other ways
StevensGino: thanks
sprkrd: actually that article is not too specific regarding the evaluation function, so it gives you a lot of freedom
sprkrd: it says distance to the landing zone - penalties if angle and/or speed constraints are violated
StevensGino: I am trying, thanks
Anone-Imouse: anybody wanna play?
https://www.codingame.com/clashofcode/clash/1795801c26440d6926ed6e7d118c7836844ecbf
BlaiseEbuth: Nein. -> #clash
-Shuffle-: can you somehow see your past clash of code results?
-Shuffle-: like for example from my first participation
Ricksters: um the only way I know to see the results are just by scrolling through the notifications from the bell icon on the top right, you can see all your past clash of code results from there as well with other things
MACKEYTH: Just won a clash! Now I'm drinking celebration vodka instead of consolation vodka.
It_potato: guys, how can i join to the world ru?
struct: /join ru
jacek: more like /join #ru
jacek: :scream:
RaulParisMurillo: How do you play escape code? I have request access but I'm still waiting with a friend :(
Dark_bloom: hello I am new to this platform how do i improve my coding skills in python
ReginaPhalange: Just do it
ReginaPhalange: _shia lebeouf
jacek: oO
struct: Dark_bloom i would start with easy puzzles
struct: but i dont know what your skill levle is
Dark_bloom: I am at a beginner's level
jacek: try The Descent, or Temperatures puzzle
Dark_bloom: is there any books or videos i should refer to or just go with flow
Nzk: depends on what you wanna learn
Nzk: :eyes:
Spicy_Oreo: dark what language u plan on learning ?
reCurse: Why is cmake so damn annoying
jacek: ohai
Spicy_Oreo: udemy has pretty goof courses on python
Spicy_Oreo: gapped*
Spicy_Oreo: good*
jacek: :thinking:
Spicy_Oreo: bruh apple auto detect is fcked
JBM: seemed perfectly on point to me
MSmits: it shows how he needs a goof course on typing :P
struct: I hope i finish this soon
jacek: the course?
struct: uttt
jacek: :scream:
struct: I started today
struct: do not worry
KiwiTae: i think im missing smth https://www.codingame.com/replay/562167805 :joy:
jacek: :upside_down:
struct: seems like the solver is working
struct: at least I hope
Bob23: any tips for a beginner
olaf_surgut: dont ask for tips
blindo: Why not ask? My tip: just do it
JBM: tips for a beginner: improve
blindo: Tips for a pro: improve
olaf_surgut: better is to ask for some unknown topics, not tips
KiwiTae: Bob23 pm mods they like it :stuck_out_tongue:
JBM: or just advertise private clashes
Bob23: Nice, I knew I could count on the internet for encouragement
JBM: that's what we're here for
Bob23: lol
_Ventox_: Can you play the same clash of code again after completing it?
JBM: repeat clashing until it comes up again
JBM: gain enough level and play it from the accepted contributions' pane
JBM: notice that "after completing it" is never relevant
Michael_Howard: How many nodes does Monte Carlo tree search need before it stops sucking like a giant black hole?
IgnacyJ: dudes i just had to go to toilet during clash of code
IgnacyJ: btw how to stop clash chat from appearing?
struct: you can disable it notifications right?
struct: https://www.codingame.com/settings/notifications
struct: ah clash chat
struct: my bad :p
struct: I thought he wanted to disable clashes invites
JBM: just make sure they're the right ones
PiterYeh: hello everyone
blindo: Hi!
PiterYeh: did anybody have timeout issues in a specific test case for space maze, the solo puzzle?
blindo: Not here
PiterYeh: sigh... i have random timeouts in a test case, and also in a validation case
PiterYeh: i should have a time budget of 50ms, but according to my times i get killed for timeout by CG after 30... 20... sometimes 7 ms
blindo: Maybe there are some admins or whatever they're called here to help you out. I hope
blindo: Sounds like a shitty problem to have :/
KiwiTae: PiterYeh which puzzle?
Westicles: do you start your timer after inputs are read?
PiterYeh: KiwiTae space maze
PiterYeh: Westicles i start my timer right after the first input of every turn
PiterYeh: blindo yeah it's been driving me crazy for the last 40 minutes, so here i am asking the community :D
Westicles: should start after last input I think
KiwiTae: time starts when u start reading inputs
KiwiTae: but maybe u just have a while loop smwhere
KiwiTae: or a crash
KiwiTae: usually tells you timeout even its crashing
therealbeef: crashes are the most typical reason for unexpected timeouts
PiterYeh: hmmmm so maybe it's just a crash huh
PiterYeh: good point
PiterYeh: thanks, i'll go and try to see if it's because of that :)
KiwiTae: id say run it of cg ide with gdb if your in cpp dunno
KiwiTae: i usually do that
therealbeef: maybe those turns which timeout have something in common with respect to the inputs or game state
PiterYeh: yeah yeah i have my debugger already set up! if it's a crash i should quickly find out why
PiterYeh: brb
PiterYeh: damn... i think i run out of memory
PiterYeh: if i recall correctly CG allows around 750MB of ram
PiterYeh: and my algo only finds the solution after eating 927MB of ram :D quite hungry
PiterYeh: thanks for the help, i was just stuck!
KiwiTae: now time to fix it :")
KiwiTae: :*
LelouchVC2: fixing is gay
LelouchVC2: code it right the first time
blindo: Fixing is gay? lol..
blindo: Not only is your comment condescending, it's also homophobic. I don't really care, but it doesn't cost anything not to be an ass..
LelouchVC2: why is it homophobic? u should be gay more often by fixing code
KiwiTae: :rainbow:
therealbeef: where's a mod when you need one...
blindo: So the word gay got its connotation to same sex relations in mid 1900 sometimes
blindo: Are you really referring to the meaning of the word more than 70 years ago?
blindo: Get a grip
Westicles: Hasn't South Park taught us anything?
blindo: It has taught us lots of stuff
reCurse: The trash was taken out, let's move on
PiterYeh: thanks
therealbeef: :thumbsup:
blindo: :thumbsup:
Westicles: :kiss_ww:
Skinjbir: hello world
blindo: Hi!
Nerchio: what is the slowest step of mcts?
ClockSort: s
ClockSort: I would say the rollouts are the slowest step, usually
struct: im not sure Nerchio
struct: you can make rollouts and expansion heavier
Nerchio: i did some profiling and my selection with UCB takes insane amount of time
Nerchio: but i cant see any bug?
struct: do you mind showing it?
Nerchio: what UCB calc or time
struct: ucb
puyoxyz: any way to increase font size of just the editor?
puyoxyz: (without making everything else bigger)
struct: ctrl zoom
Stormalix: ..
Stormalix: there's a setting on the right side
struct: i meant ctrl + mouse wheel sorry
struct: if you are mouse hovering the ide
Stormalix: oops i meant left side
Stormalix: im dumb smh
MACKEYTH: Is it possible to practice CoC puzzles solo?
MACKEYTH: I think I just did one with an incorrect description, wanted to confirm.
KiwiTae: the palyndrome one?
MACKEYTH: No, hill climbing
KiwiTae: https://www.codingame.com/replay/562196722 struct hehe fixed it
struct: MACKEYTH check the pm
struct: good job kiwi
KiwiTae: still need to optimize a bit im landing without fuel so missing 1 achievement :')
MACKEYTH: Thx Struct
struct: np
MACKEYTH: It's "King of the hill"
dtator: Is there any way to display debug messages?
KiwiTae: yes use stderr its usually ritten in comments from default code
dtator: Sorry, guess I should have read the comments in the code. I feel dumb now
Boman: haha I feel dumb now too :)
Boman: I just went to google it... but yep - it's in the comments
Boman: as a side note, you can still just print it and it will show... you'll get the "debug" info but your test will fail too.
dtator: I'm running CSB and trying to store the checkpoint x,y so just outputting wouldn't work
KiwiTae: dtator use variables?
dtator: I know how to store it, was just confused how to output debug messages to confirm it was working correctly
FrancoRoura: Has anyone been able to reach depth 3 on a minimax for connect4 using Python (Without timing out)?