Chat:World/2021-03-08
b0ot: If you pass all the test cases but then fail one on submission, is there any way to see if you had an error or if the answer was incorrect?
MSmits: nope, but try to make your program more general. If you hardcode a test case, your solution might not work for a case that is similar but different
b0ot: Thought that might be the case. I don't actually have anything hardcoded. Its odd... probably quicker to re-write the whole program
MSmits: well i dont mean hardcoding exactly, just something thats less general
MSmits: to deal with a case that you didnt know how else to solve
b0ot: I think I get what you're saying but the code doesn't have any special case coding
MSmits: other than that it is also possible that a puzzle is just not clear enough about the kind of cases you can expect
MSmits: which puzzle?
b0ot: Equivalent Resistance, Circuit Building
MSmits: ah sorry, thats a recent one. I havent done puzzles in a while
b0ot: Yeah, I pass 6/6 test cases before submission 5/6 after submission
MSmits: later today there should be more people online. Someone will have solved it
derjack: good morning
Xotiic_312: hahaha so funny good morning at 8:43pm
derjack: pm? o.O
derjack: oh new zealand is 12 hours ahead
Atsgnad: Really enjoying the site and what it has to offer, not the usual "Hello World!" jumbo mumbo.
Imsure1200q: mj
anantaCodes: i lost my code i was working on since yesterday :(
anantaCodes: ..
darkhorse64: did you run it in the CG IDE ?
anantaCodes: I mean i made a single submission with 69% accuracy
anantaCodes: and then I made lots of changes to the code .
anantaCodes: accidentally I pressed to load the previous solution to my ide
anantaCodes: and now the old one is lost
derjack: :(
anantaCodes: i am dumb
anantaCodes: 😢😢😢😢
derjack: there are 2 types of people: those who don't do backups. and those who will
Xotiic_312: and you anantaCodes are the perso who does not backup up
anantaCodes: more salt
anantaCodes: throw me in the fire
derjack: MSmits any breasts mentions in the class?
darkhorse64: no turbulence in the classroom
bigmazi: anybody else experiences (time to time) blank inouts/ouptus samples in ClashOfCode?
MadKnight: just hit Reset code
MadKnight: and if no then give us specific CoC names
derjack: dont forget to backup code
MadKnight: he said they were empty
MadKnight: there's literally nothing to backup
MadKnight: dude jack
derjack: he said input/output were empty
MadKnight: what else is there ?
MadKnight: samples are usually just a pure i/o sample
derjack: imports for example
derjack: but what can you know
khraal: Hi, I've some issues in C programming with Factorial VS Exponential, my execution requires too much time and I don't know how to reduce it
AcornBob: I want to contribute a clash-of-code puzzle, but is there a way to search all existing puzzles to find out if it has already been done?
derjack: khraal do you brute force your solution
nnovich-OK: Funny enough, you don't need to worry about it :)
AcornBob: "Contributions must be original. (for all games but Clash of Code)"
nnovich-OK: It's from guidelines in CG itself https://www.codingame.com/playgrounds/40701/contribute---help/contribution-guidelines
khraal: yep, but factoriel is over double, so its a math problem rather a prog problem
KiwiTae: khraal logarithm is monotonic
KiwiTae: hint hehe
ChickenX: how can i debug values in codingame?
DaNinja: should say in the sample code
DaNinja: To debug: cerr << "Debug messages..." << endl;
V_Brawl: can someone help me? i have a circle and a point on it (touching the circle) now i want to transfer that point 30 angles clockwise
KiwiTae: p2.x = xcos(30)+ysin(30) p2.y = -xsin(30)+ycos(30)
MadKnight: i PMed him 3 methods
MadKnight: and he was confused over something else
V_Brawl: KiwiTae thank you too, for the formula
UnnamedCodinGamer: is there a cleverer way to test two versions of a program locally than adjusting the methods. Something like one program is in one file, the other in another and there is a program that regulates which one of the two is executed
JLukeSkywalker: i think thats the normal way to do it
UnnamedCodinGamer: which of the two?
JLukeSkywalker: the 2 files with a testbench
UnnamedCodinGamer: how do I call the two files from a third one?
V_Brawl: in python you can use subprocess
UnnamedCodinGamer: I will look into it
V_Brawl: prg = subprocess.Popen('cmd command'.split())
UnnamedCodinGamer: they are c++ programs
JLukeSkywalker: are they compiled?
UnnamedCodinGamer: they can be
JLukeSkywalker: i would just write a bash script to run them, can even include compile lines into it
JLukeSkywalker: what exactly do you want to test in them?
UnnamedCodinGamer: the thing is that they should be able to pass inputs to each other - something like local arena
JLukeSkywalker: cant you just include the files and make functions
JLukeSkywalker: in your 2 files, make everything functions, then in the main file, include them and use the functions
UnnamedCodinGamer: I can unify them in one program and call methods with different parameters
UnnamedCodinGamer: yes it is similar
JLukeSkywalker: what is your goal with these 2 files
UnnamedCodinGamer: they are two bots I want to see winrates
JLukeSkywalker: and how are you running the game
UnnamedCodinGamer: currently on CG only
JLukeSkywalker: if you download the game, in the main file you pick which bots it uses
JLukeSkywalker: would just pick the ones you want
UnnamedCodinGamer: I have not thought of that
JLukeSkywalker: gameRunner.addAgent(WhateverBot.class)
JLukeSkywalker: i only know how to add python and java bots, but there has to be a way to add c++
UnnamedCodinGamer: I will look into it
UnnamedCodinGamer: thanks for the suggestion
Astrobytes: UnnamedCodinGamer: brutaltester
Astrobytes: https://github.com/dreignier/cg-brutaltester
Astrobytes: Depending on the game you may need to make some adjustments to the referee to make it work.
UnnamedCodinGamer: it seems a bit overly complicated for my purpose
Astrobytes: Well, it plays both versions of your bot and spits out a nice table with winrates
Astrobytes: It looks far more complicated than it actually is
UnnamedCodinGamer: would it work with clobber referee? it is not listed.
Astrobytes: You'd have to modify the referee, details are in the docs
Astrobytes: For community multis though rather than contests or previous contests I'm usually lazy, just have two bot versions included and make s small testing framwork
Astrobytes: *a small testing framework
Astrobytes: afk 5 mins
UnnamedCodinGamer: yes, it is a rather small thing that I want to test
UnnamedCodinGamer: for the time thinking and talking about it I would have already made it :)
Astrobytes: lol
UnnamedCodinGamer: I implemented the "solver" extension of mcts as far as I understood it and want to see if it is any good
Astrobytes: Ah nice UnnamedCodinGamer
Astrobytes: nice improvement darkhorse64
darkhorse64: 6x more rollouts helps a bit
Astrobytes: Ever so slightly it would appear :)
darkhorse64: from a poorly written code, no magic here
darkhorse64: yep
darkhorse64: This is one of the greatest asset of CG: constraints
UnnamedCodinGamer: even after implementing optimizations discussed here and MSmits rollout method I got to around 20K
darkhorse64: ofc, the 150K rollout second turn depends on the machine. Sometimes, it's 120K
MSmits: UnnamedCodinGamer it also matters how you do your rollout
MSmits: you can do 1 child at a time
MSmits: or all at once
MSmits: the second will give you more rollouts
MSmits: unless you still count all children as 1 rollout (I usually do)
UnnamedCodinGamer: I do one at a time, full rollout until end game is reached
MSmits: I get 1600-1800 of these full rollouts in turn 2
MSmits: if you do only 1, it is very hard to compare with our method
MSmits: your method might actually be better
MSmits: 100+ sims for a single expansion is a bit much
darkhorse64: It's not just sparing time on select, it makes the expansion simpler and it fits well with a solver
MSmits: yeah but i doubt that affects efficiency a lot. It's mostly convenience
MSmits: select is the most important I think
MSmits: in uttt i still do only 1 child at a time. I honestly tried the all-children way for 5 different bots
MSmits: it was never better
MSmits: sometimes around the same, but never better, often worse
darkhorse64: ofc, this biases selection but this can be counterbalanced somewhat with the exploration factor
MSmits: maybe i should have refitted exploration when i did this
AntiSquid: hey is anyone here bitboarding hex-boards? wonder what hex-board representation is easier to bitboard, square or fake 3D cube ?
MSmits: i can answer the first question
MSmits: everyone who did yavalath
MSmits: (seriously)
darkhorse64: ^
MSmits: but i never did anything beyond just numbering left to right
darkhorse64: ^
AntiSquid: ok so do you bitboard ? and what type do you use lol
MSmits: you use pext/pdep to get the correct patterns
MSmits: type?
AntiSquid: yes, when iterate through rows / columns
derjack: huh
MSmits: i dont use those methods
MSmits: I just look at the hexboard
MSmits: and number the hex tiles left to right
MSmits: 0, 1, 2, 3
darkhorse64: doing penguins ?
MSmits: and that corresponds to the bitboard positions
AntiSquid: you have 1D array ?
MSmits: no, a bitboard
derjack: for yavalath use pdep/pext to get row-4 or row-3 patterns to see if theres win or lose
Astrobytes: no just a bitboard
Astrobytes: no arrays
MSmits: it's 1 uint64_t per player
MSmits: and hex 0 is the first bit
MSmits: hex 1 is the 2nd bit
MSmits: etc.
darkhorse64: and lots of tables
MSmits: to know whether you made 3 in a row or 4 in a row, you use lookup patterns
MSmits: pdep/pext
AntiSquid: nvm just confused because it's in hex
MSmits: to be clear our way completely removes any geometric qualities from the board representation
MSmits: you can only do lookups
MSmits: so it's not that great
MSmits: but it makes for compact bitboards
AntiSquid: darkside yes i am doing pengus now, how did you know ? lol i mean i intend to try the others too i think depends how it goes
AntiSquid: darkhorse64
V_Brawl: does anyone know when the velocity vectors get unlocked in CodersStrikeBack??
MSmits: darkhorse64 seems quite random which of us is nr1 clobber :)
darkhorse64: I guess that from your questions. Rn, I do not have a search
V_Brawl: or a way to calculate the velocity vectors
darkhorse64: Fitting parameters
MSmits: guess we basically have the same bot
darkhorse64: You can compute velocity from previous,current positions
MSmits: I'm not going to work on clobber until i can put the math stuff in and that will be a month or two at least
AntiSquid: MSmits alright, was thinking to use one int for each row, but without bitboarding you have a fake 3D square alternative (3d array, but only use 3 connected surfaces of it) so was wondering if i should try to represent that as ints somehow
MSmits: well it depends on your search
MSmits: if you do mcts it might be worth it to have a compact representation to, for example, put on the nodes
MSmits: minimax only has one state you are modifying
MSmits: so in that case its just do/undo
MSmits: maybe make a good bot first and then optimize? Or do you already have one?
AntiSquid: i might use mcts but i am not sure yet
MSmits: i am not great at these games with more than 2 players
JLukeSkywalker: V_Brawl: it gives them in gold, unfortunately have to just calculate them in silver or lower
AntiSquid: yes but no clue what representation i want to use yet :D
JLukeSkywalker: for calculating, just using last position is usually good enough
MSmits: havent done the penguin game yet, so cant help you any more than this AntiSquid
V_Brawl: yeah but i don't know how
AntiSquid: knightmoves wrote on his blog he uses mcts and how he had to optimize to cover 3player and 4players too , that's where his blog post ends
V_Brawl: i have to store the last x and y
V_Brawl: then what with the updated?
MSmits: AntiSquid typical, i dont think many players actually find a good solution for 3-4 p model. It's always messy
darkhorse64: Link please ?
AntiSquid: 2 points lead, think he has one, didn't share it
MSmits: anyway, gotta go home
MSmits: catch the train
MSmits: ttyl :)
AntiSquid: https://coganblogs.blogspot.com/2020/12/codingame-building-ai-to-play-and-win.html
darkhorse64: :relaxed:
JLukeSkywalker: V_Brawl: yes. its not perfect, but its accurate enough to get out of silver
AntiSquid: some heuristic scoring for 3 / 4 pl
MSmits: ohh
MSmits: i got sucked in by that blog post
AntiSquid: aren't you on the train yet ?
MSmits: finally someone articulated that tempo bonus i jhave been using for many games
MSmits: i wanted to...
MSmits: but then this blog
derjack: tempo bonus?
MSmits: that tempo bonus is actually important for oware as well
MSmits: read the blog
MSmits: i am not sure the tempo is the correct name here
MSmits: it's more like a correction for horizon effect in mcts
MSmits: its very strong in mcts with eval
MSmits: so you need to give bonuses or penalties depending on which player who is next to move
MSmits: minimax doesnt need that because all nodes being compared are at the same depth
derjack: thats why my NNs has different inputs for player to move
MSmits: yes
MSmits: exactly
derjack: blitzkireg and stuff
MSmits: i always evaluate this
derjack: zugzwang*
MSmits: in oware the number in eval is quite high
MSmits: the param
MSmits: in fact, in oware your eval drops when you move
MSmits: because when you move, you make an empty pit
MSmits: and empty pits are penalized
MSmits: so you correct this with the "tempo" bonus
AntiSquid: :thinking: this is how you delay MSmits from arriving home, now need to find out how to use it to my advantage
MSmits: it's easy, just this:
MSmits: += player? TEMPO : -TEMPO
MSmits: fit TEMPO param
MSmits: I kept this to myself a long time because when i found it, my bot got a lot stronger, in oware anyway
MSmits: but there you go, enjoy :)
derjack: and then youre in zugzwang and BAH!
MSmits: TEMPO could be positive or negative
MSmits: sure, it might not be right for every state, but having it and fitting it to 1 value is better than not having it
OmarZaweayhAlyamaa: could any one give me some tips
MSmits: https://letmegooglethat.com/?q=tips
MSmits: any time :)
reCurse: What service did you perform?
OmarZaweayhAlyamaa: I am fighting the 4th boss
OmarZaweayhAlyamaa: I am stuck on it for like 2 hours ;(
orangesnowfox: Hello anyone who remembers me (I've changed my username since the last time I've talked)
MSmits: anyway, catching my train for real now. Cya
MSmits: are you Astrobytes?
orangesnowfox: No lol, I'm izik1
MSmits: oh
MSmits: thought you were his weird training alt :P
MSmits: anyway ttyl
derjack: any good resources on multiplayer mcts?
derjack: OmarZaweayhAlyamaa what game
OmarZaweayhAlyamaa: car racing
OmarZaweayhAlyamaa: with check point
AntiSquid: those aren't cars !
derjack: bitrunner?
OmarZaweayhAlyamaa: strick back
OmarZaweayhAlyamaa: strike """
AntiSquid: is that a jojo reference?
HunterEhrenfeld: dog in space
Astrobytes: who's alt are you calling weird MSmits!
HunterEhrenfeld: #RemoveShortestMode
darkhorse64: You're kidding. It's the mode where I suck the least
HunterEhrenfeld: its the mode i suck the most! lol
AntiSquid: it's the only mode that redeems clash by about 1%
HunterEhrenfeld: i mean, im admittedly trash at code golf lol
AntiSquid: i mean the 5-10s submits are bs
struct: Depends on the clash
struct: 10 sec on a few clashes is not impossible
AntiSquid: even harder ones get submitted in 5s seconds
HunterEhrenfeld: i mean, this one is a binary XOR and someone got 73 characters
HunterEhrenfeld: idk how lmao
struct: Yeah, that is cheating AntiSquid
AntiSquid: you can save your previous solution
JLukeSkywalker: python an xor is legit just ^ after you convert them to ints
struct: inst xor just a ^ b?
HunterEhrenfeld: thats cheating! lol
Tiouz: print(int(input())^int(input()))
darkhorse64: golf is weird at first sight but can be quite funny with python, bash, ruby, php, js
JLukeSkywalker: maybe needs a bin()
JLukeSkywalker: but yeah
darkhorse64: I=input ?
JLukeSkywalker: ^^ most important python line
JLukeSkywalker: if inputs + non-looped prints > 2
baguettes: Is there a reason for the ocaml syntax highlighting to be different than all the others?
JLukeSkywalker: maybe its trying to get you to use a different language
baguettes: Maybe :thinking:
agtxdy: shortest mode shouldn't reveal # of characters for other people until final submit
lopidav: agtxdy you should suggest it on the forums
pindsz: agtxdy, why not?
kostis14: hey guys any way to find a clash of code i just played and redo it?
BlaiseEbuth: Try here kostis14 https://eulerschezahl.herokuapp.com/codingame/puzzles/
BlaiseEbuth: :egg:
nima_sedaghat_nia: rgg
nima_sedaghat_nia: egg
nima_sedaghat_nia: django
nima_sedaghat_nia: flutter is best
nima_sedaghat_nia: not?
AntiSquid: idk]
AntiSquid: what are the arguments in favor of it
MadKnight: AntiSquid discord
jacek: lunacord is better ship
AntiSquid: no info there, might as well write "can i ask a question"
AntiSquid: and you can see i am online @_@
NicknameAlreadyTakenHelp: my pc cannot run this website
Astrobytes: Let the website run your PC.
NicknameAlreadyTakenHelp: great idea
Passifi: My rapsberry pi can run this website maybe you should consider updating your VIC 20, mate
Astrobytes: lmao
SwagColoredKitteh: i may or may not exist
SwagColoredKitteh: not sure yet
Astrobytes: Existential crisis? :P
SwagColoredKitteh: existential types!
SwagColoredKitteh: but yes
SwagColoredKitteh: hoi Astrobytes
Astrobytes: hehehe Hey SwagColoredKitteh
SwagColoredKitteh: hehehehe types
SwagColoredKitteh: how've you been?
Astrobytes: Are you Haskell'ing
SwagColoredKitteh: unfortunately i've been cursing at dart
SwagColoredKitteh: usually i'm rusting
Astrobytes: Yeah, not great, not terrible. And yourself?
Astrobytes: Aha I see.
SwagColoredKitteh: not great, health issues such as constant dizziness (woo!)
jacek: :wine_glass: ?
SwagColoredKitteh: nah no alc :p
SwagColoredKitteh: i guess in part it's not really dart i'm cursing at, more that mobile OS' are so crippled
Astrobytes: Lovely! Nothing quite like a debilitating condition to keep you happy in these oh so amazing times eh
SwagColoredKitteh: yes very much lovely!
SwagColoredKitteh: oh and google being like "hey your phone should just go through us to wake your apps up"
no thanks i'll just use a foreground service
Astrobytes: Just be sure it's not Dart and/or mobile OS's that's making you dizzy :P
SwagColoredKitteh: haha :P
PatrickMcGinnisII: vic20 lol
PatrickMcGinnisII: Kotlin on an 8-bit ... existential crisis in the making
Astrobytes: trictrac: Boss is not easy eh
jacek: which
Astrobytes: ClobberSan
jacek: huh? he cant beat boss?
Astrobytes: It's a trickier boss for alphabeta bots. I'm coming to the conclusion that I may have to switch to mcts
AntiSquid: how's life SwagColoredKitteh :o
AntiSquid: is that the actual name of the boss Astrobytes ? clobbersan ?
SwagColoredKitteh: not great, how are you?
AntiSquid: i am alright
Astrobytes: AntiSquid: No, unofficial title since we can't have named bosses in community multis
AntiSquid: how's your coding life then ? is that great?
SwagColoredKitteh: has its ups and downs, currently fighting with dart and flutter
SwagColoredKitteh: well, with currently i mean yesterday
SwagColoredKitteh: i mean flutter works great but dart is not a very nice language imo, and then there's the usual things about mobile app development (yuck)
AntiSquid: you can't use any other language for it?
AntiSquid: i think i looked at flutter long ago, think there was some payment attached and then i skipped it
AntiSquid: or maybe i am thinking of something else
AntiSquid: just googled: TypeScript, Go, JavaScript, Kotlin, and Java are the most popular alternatives and competitors to Dart.
So you have JS and Kotlin! Or is Dart simply best for some reason?
Astrobytes: Go isn't too bad
Astrobytes: I mean I haven't used it for anything big but it's less infuriating than Java at least
Astrobytes: And JS
Astrobytes: (imo, ymmv)
jacek: what would be the eval for clobber? mobility is the same for both players
Astrobytes: Well I'm not going to give it away in chat...
Astrobytes: There are numerous heuristics to use
jacek: its ok youre last :v
Astrobytes: Yeah yeah :P
Astrobytes: It's good to consider your neighbours. There.
Tarkro: Hey guys, how's everyone doing? I've got a couple of questions about the CodinGame Sync app settings. Just curious about what each one does tbh.
Tarkro: What does...
Tarkro: Auto Background do exactly?
ridafkih: When I hit submit it sends me to the lobby screen with the timer at 0
Tarkro: Prompt for backup on submit (multiplayer only) do exactly?
AntiSquid: now clobber also appears just in progress
AntiSquid: despite me starting it
AntiSquid: submitted a bot
darkhorse64: Yep, no battles for you
jacek: codingame sync?
Tarkro: https://www.codingame.com/forum/t/codingame-sync-beta/614
Tarkro: Also, info at the bottom of the FAQ page
Tarkro: https://www.codingame.com/faq
AntiSquid: resubbed, now it's just clobber
AntiSquid: what does that have to do with anything tarkro lol
AntiSquid: did you run code before trying to leave page Tarkro ?
darkhorse64: trictrac got angry and wrecked Clobbersan
trictrac: Thanks to Astrobytes who gives me some tips
Astrobytes: You're most welcome trictrac.
AntiSquid: using san at the end is cultural appropriation
AntiSquid: Automaton2000 do something
Astrobytes: It was inspired by you AntiSQuid
Automaton2000: or do you have ?
AntiSquid: when i use it it's cultural appreciation
**AntiSquid waves double standards flag
Astrobytes: We were pretending to be weebs at the time, there. Appreciation :P
AntiSquid: seriously, why is it not made possible for us to give boss names
Astrobytes: Yeah, somewhat annoying. Very minor issue though. Won't be fixed :P
AntiSquid: maybe i should do a multi with levels like some of the opti games, each level has a boss, so then it makes sense at least to have boss #
AntiSquid: 300 bosses, 300 levels, 300x25 xp :o
Astrobytes: I think (don't quote me on it) that there is a limit.
AntiSquid: it's not 6 i bet
AntiSquid: for WIP or draft contribs every wood league would get a square at the top so you can click through them and test them, but then just because they are not all displayed it doesn't mean it stops there, we have to test this and approve a game with 100+ levels :D
struct: should be simple to test
AntiSquid: without approving ?
struct: with approving it might change
struct: right
AntiSquid: ok connect 4 is not in progress anymore for me
AntiSquid: maybe they changed something and submitting a broken bot initially doesn't count
AntiSquid: now i made it random
jacek: connect4 has steal option
Astrobytes: trictrac: See, I told you so! Now give me all your alpha-beta secrets :)
AntiSquid: don't think that matters for a basic submit
darkhorse64: A good Clobber heuristic may make it for EPT
Astrobytes: This was my thinking darkhorse64 but I want to exhaust a/b approach first.
darkhorse64: A valid heuristic is an asset whatever is the search algo
AntiSquid: shit . only now remembered i could use: - 'A' to get hand position based on hand letter in fireworks T_T
AntiSquid: card letter *
darkhorse64: - '1' for the value
AntiSquid: 'A' - 'A'
struct: "Multiplayer games should have no more than 20 leagues"
struct: oh well
struct: https://i.imgur.com/3xJgE8y.png
Astrobytes: 20!
Astrobytes: Well, twenty!
Astrobytes: Interesting.
Toni.P: what is utiity of map()
jacek: :?
Maexel: map is applying a function on each element of an iterable
AntiSquid: 20 ? haha can think of something funny right now
Astrobytes: It's a web thing. I just know it.
Astrobytes: *weeb dammit
AntiSquid: if you knew what i thought of, you wish it were
AntiSquid: https://edition.cnn.com/travel/article/voyager-station-space-hotel-scn/index.html someone shared with me, do we need masks for this shit too? not that i can afford the trip currently :P
ZarthaxX: wtf!
AntiSquid: tryangle is puzzle of the week, ironaically :D
JLukeSkywalker: its such a cool puzzle, but im so lazy
Nachosauce: Yeah I looked at it and decided 'nope, not today'. Just too much going on for my tired brain haha. Very cool puzzle though
Nachosauce: I deeply dislike that they include newlines and tabs in the code size of code golf.
JLukeSkywalker: its part of the challenge, working on unreadable code
Nachosauce: but everything I write is already unreadable code