Chat:World/2021-05-31
Atomic_coder: hi guys im back after 2 years
Husoski: Hi! How was prison food?
Husoski: :_
Husoski: :)
Chainman: whaaat
Chainman: It's good in norway I heard
jacek: c4 potw :bomb:
drolee: commit a crime in norway for high quality food?
padobranac: -1"BYp
Tigran0000: я русский человек
Tigran0000: и я балдею
derjack: :scream:
MarijaLiutkeviciute: :open_mouth:
KiwiTae: easdasd gz more time for contests
ArtMajor: yeah there were only 4
ArtMajor: what you said makes sense though
easdasd: hello guys my wife is left me
ZarthaxX: has left me*
ZarthaxX: and congratz!
Manchi_o6o7: guys, is there any easy way to write a function that deletes a node from a binary tree, but the function should return an int
ArtLiteracyStory: what int?
Manchi_o6o7: I wrote the function, but it is type of NODE deleteNode( NODE* root, char *delete)
ArtLiteracyStory: the value of the deleted node?
Manchi_o6o7: the function should return 1 if the node is deleted
Manchi_o6o7: NODE *deleteNode( NODE **root, char *delete)
Manchi_o6o7: this is my protoype, sorry
ArtLiteracyStory: Are there any assumptions you can make about the values in the tree or can they be in any order?
Manchi_o6o7: they are sorted alphabetically
ArtLiteracyStory: After you delete the item, you'll need to heapify the tree
ArtLiteracyStory: I think
ArtLiteracyStory: sounds like it's a min heap with letters
Manchi_o6o7: is there any way that I can return an int in some cases, rather than a NODE *tree
Manchi_o6o7: I delete the NODE properly
Manchi_o6o7: but I want to return 1 if it is succesfully deleted
ArtLiteracyStory: you'll need to binary search for the node and if binary search fails, return -1
ArtLiteracyStory: or something?
Manchi_o6o7: yes, but I can't return -1
ArtLiteracyStory: what do you want to return if the search fails?
Manchi_o6o7: because my fucntion is type NODE*
ArtLiteracyStory: the return type is NODE*?
Manchi_o6o7: yes
ArtLiteracyStory: You could return NULL if it fails.
ArtLiteracyStory: but you are trying to return -1?
ArtLiteracyStory: oh wait I see
ArtLiteracyStory: You want to return 1 if it succeeds
Manchi_o6o7: yes, the null part is okey
Manchi_o6o7: but how can I return 1
Manchi_o6o7: if it goes well
Manchi_o6o7: http://chat.codingame.com/pastebin/a10d1175-d01f-460e-99c7-f5edbd46f78e
Manchi_o6o7: here you have the function
ArtLiteracyStory: I mean I think you could technically return 1 if you wanted
ArtLiteracyStory: The caller would probably not expect it. Typically when you return a pointer it's expecting an address to a NODE or null. So it might have some issues.
Manchi_o6o7: I don't know how can I deal with it properly
ArtLiteracyStory: Why do you want to return 1?
Manchi_o6o7: it an university task
Manchi_o6o7: it is*
ArtLiteracyStory: they specifically said deleteNode's return type is NODE* and that you should return 1 if the search succeeds?
Manchi_o6o7: it can be type int
Manchi_o6o7: but I don't know how to delete a binary tree not reursively
ArtLiteracyStory: oh
ArtLiteracyStory: You can use a queue or stack I think, can't remember which one
ArtLiteracyStory: I think a stack
ArtLiteracyStory: Here's an iterative solution https://www.techiedelight.com/delete-given-binary-tree-iterative-recursive/
ArtLiteracyStory: They use a queue
Manchi_o6o7: yes, the delete the complete tree
Manchi_o6o7: I need just one node
ArtLiteracyStory: oh
Manchi_o6o7: maybe it is the same logic
ArtLiteracyStory: Do you have to maintain the tree such that it's like a min heap?
ArtLiteracyStory: keep it alphabetical after removal of the node?
ArtLiteracyStory: i'd look into iterative min heap
KiwiTae: Manchi_o6o7 u can use refs bool deleteNode( Node** , char* , &Node out)
KiwiTae: then just fill out if you need it
KiwiTae: and use boolean or int value in return statement
Xzoky174: how 2 delcare variables in html? pleas help
Uljahn: oO
KiwiTae: var Xzoky174
Xzoky174: you weren't supposed to do that
VizGhar: maybe I'm too old, but... HTML variables is a thing now? :D
derjack: HTML is a programming language
KiwiTae: its not though
InternalErrror: it is
InternalErrror: not sike
TranTuan1: https://www.codingame.com/clashofcode/clash/1785665a143095b2e2d0954a212098ed8e54059
TranTuan1: https://www.codingame.com/clashofcode/clash/17856715b58448f7ecad7f95dac6b49571fb451
Uljahn: TranTuan1: spam is bannable here, use #clash channel for posting coc invites please
codin_compuder: ?????????????????????????????
TranTuan1: I don't khew thay.Sorry
Uljahn: np
codin_compuder: ###################i cant do this thinnnnn
ANONYMOUS42: \join in
ANONYMOUS42: whoops wrong slash
codin_compuder: how the #### dp
codin_compuder: um
derjack: ohai
Hamzailer: how do i close the chat?
ddddfgsgf: you can hide or its not enough ?
Hamzailer: how do i hide it?
Astrobytes: click the little triangle below this chat
ddddfgsgf: under this text box there is button on left side
Hamzailer: ah
Hamzailer: thanks
derjack: hi boreddd
Wontonimo: hey derjack and Astrobytes, how's things?
derjack: monday things?
Wontonimo: sounds about right
derjack: finally sunny weather without the risk of sudden rain
sbdm666: hello boisd
sbdm666: bois*
Wontonimo: it snowed here last Friday. That was weird
Wontonimo: killed a lot of bugs which I'm not complaining about
Astrobytes: yeah, weather's nice here too
derjack: snow? in canada? w00t?
Astrobytes: lol
Marchete: 30ºC here
Astrobytes: 21-22ºC here. I miss London summers. When I moved back up to Scotland from there it was 36ºC when I left, and 17ºC and raining when I got here (in September)
Marchete: 20-29 is nice
Marchete: but Madrid at summer is not suitable for humans
Marchete: +40ºC
1rre: 40°C @ 10-30% humidity is unironically better than 20°C @ 80-100% humidity
Astrobytes: Yeah, I worked a year in Corfu once, +40ºC too. Sleep for a few hours when it's hottest in the afternoon. I like it 30-38ºC
1rre: Even 50°C in a desert with low humidity is better than 25°C in the UK
Astrobytes: lol, not wrong
KiwiTae: what about 40+ with 100% humidity?
struct: 40º is not that bad
struct: I rode my road bicycle with that temperature, my bpm were 20 higher with same power output
Astrobytes: I sanded the interior of a 3 storey house in that heat (the big white Greek houses)
Astrobytes: That was less than fun.
Astrobytes: And I didn't get paid.
derjack: oO
struct: I had to mount chairs of a stadium with around this temperature
struct: also not fun
Marchete: you got paid ;)
struct: but at least I got paid
Scarfield: apparently there is not a term like wind chill for warm air
Astrobytes: Was a guy called Scottish Dave. Bumped into him a few months later in a bar I was working at "oh oh, hi, I'll get your money for you", never saw him again.
Marchete: ahh
Scarfield: sounds like a great guy
Marchete: I though it was about some family thing
Astrobytes: Total kn*bend
Marchete: or gf's family
Marchete: then I'm sorry for you
Astrobytes: Meh. Sht happens.
Scarfield: Sloggish Dave
Astrobytes: Was a good year overall.
Astrobytes: :rofl:
Scarfield: must have been interesting then
Scarfield: https://www.imdb.com/title/tt0401445/
Astrobytes: I have never even heard of that movie lol
Astrobytes: Looks extremely boring.
Scarfield: its actually decent, feel good movie
Astrobytes: I don't like feelgood movies.
Scarfield: my mom and her husband watches it once every year xD
Astrobytes: lol
derjack: her husband? not your dad?
Scarfield: nope
Scarfield: they divorced when i was a little kid
Scarfield: pretty unheard of :p
Scarfield: be careful about your mom jokes derjack though xD
derjack: why? you have mom
derjack: if you had 2 dads, youd be immune to yo mama jokes
Scarfield: what a life it would be
Scarfield: being bullet proof
Astrobytes: hahaha
Scarfield: im bored
Astrobytes: Borefield
Astrobytes: Why are you bored?
Scarfield: was fishing for der jack to say hi bored, im dad.
Scarfield: then i would have 2 dads
Astrobytes: Oh. I almost did actually type that.
Scarfield: xD
derjack: so close
LuisAFK: ?
TheBatMan_TM: has anybody heard from KalamriKing ?
struct: nope
TheBatMan_TM: ok
B4tiste: How clash of code problems are on the website ?
B4tiste: How much*
struct: 1210
StevensGino: which algorithm should I use in code vs zombie for top 20?
New_coder_please_help: the crying algorithm
Wontonimo: I've heard of KalamriKing. Why TheBatMan_TM?
Wontonimo: StevensGino did you find any hints in the discussion? The usual searches should be good to get high, but don't know about top 20. Probably beam with a couple if/else for special scenarios (like circles) will get you very far.
TheBatMan_TM: sry i meant has anyone heard "from" KalamariKing
TheBatMan_TM: recently
karimk123: hello boys
StevensGino: yeah, I know
struct: StevensGino Monte Carlo can get top 20
struct: you just need a lucky submit
StevensGino: really
struct: yes
StevensGino: how about GA, is it better?
Wontonimo: ah, you are already pretty high in code vs zombies. What algo are you use now?
struct: mine is hardcode
struct: hardcoded*
struct: I used MC
struct: I think some people used GA StevensGino
Wontonimo: plain MC or MCTS ?
struct: Might be good too
struct: plain MC
Wontonimo: for the win! nice
StevensGino: it should be Monte carlo
StevensGino: I am thinking of using GA for higher rank
reCurse: For top20 probably hardcoding with offline solution
reCurse: https://github.com/dbdr/codingame-validators/blob/master/cvz.txt
reCurse: Have fun
StevensGino: really
StevensGino: thanks
karimk123: hello guys
karimk123: hello kar1m
Scarfield: TheBatMan_TM yea kalamari was online the other day, friday or saturday i think
karimk123:
karimk123:
karimk123:
cegprakash: https://www.codingame.com/ide/puzzle/chess
cegprakash: super funny to watch default code play random movies
cegprakash: would be amazing if we have 30 minute games giving time for bots to think and respond :P
cegprakash: just like humans
Smelty: lol
cegprakash: then bots will take over the world :P
1rre: how do you report an issue in a challenge? There's one where one of the lines has a space at the end & it took forever to figure out that's why it wouldn't convert to int
iPocket: at the end
iPocket: you can report
iPocket: on the sidebar at the right
jacek: puzzle?
SEXYHUSKY: hi
jacek: ceg is you set seed to 0 you will get standard chess position
jacek: oO
MSmits: mmh well thats new... I've been getting creative at making files in my C++ programs and now I accidentally did a bug and got 4000 small files :P
MSmits: gotta be more careful about this
MSmits: i forgot c++ can do a lot of damage fairly easily
Scarfield: now make a script to delete these files, nothing can go wrong
MSmits: haha
struct: Could be worse
jacek: 4000? thats not much
MSmits: cuz i stopped it in time, it was an infinite loop :P
reCurse: Not sure what's C++ specific about messing that up eh
MSmits: maybe it's not actually. I'm just not used to generating multiple file. It didn't even occur to me that writing a file "it1.txt" and then a file "it2.txt" etc. in a loop might carry some risk :0
SlyCooper: Hey guys, can you tell me if there is a way to program here with more than 1 file? This is getting hard to debug xD
DomiKo: nope
jacek: no, but you can write locally in multiple files and there are tools to convert them into 1 file to CG
SlyCooper: Ok, thank you! It would be nice to make it a thing
jacek: good afternoon
jacek: MSmits connect4 the puzzle of the week :tada:
MSmits: oh cool
yassine_Benlahbib: .
DanaidechArdsamai: Hi
Notgoodatcoding5: Hi
xNotAHackerx: whos got a degree in computer science here?
jacek: i only have radians
xNotAHackerx: good one :unamused:
xNotAHackerx: jacek how long did you study cs for?
KNELE: ğ
jacek: i studied at university for 5 years
PatrickMcGinnisII: shoulda said gradients
densch: hey, quick question: in the asteroids easy pratice thing, how does one know where the "point of observation" is? like the only hints in the text are that the asteroid with letter A is the closest but nothing about the exact position or something.
densch: or am I seriously supposed to mathematically deduce which the perfect point for the opoint of observation is such that the ordering of asteroids makes sense? :O
PatrickMcGinnisII: it's a 2d picture
densch: I know. doesnt really tell me where the piint of observation is though?
PatrickMcGinnisII: don't need it...simple nx=ox+(change iny/(t2-t1)*(t3-t1)) ... that kinda thing
tinkering_around: just joined this, nice community
PatrickMcGinnisII: just compute new point by the step in the slope
PatrickMcGinnisII: draw a line
densch: oh, well, I'm dumb -.-
densch: in the end step if in the t3 picture 2 asteroids would be at the same position so they obviously would be at the same distanc away from ANY reference point. so "the output only the closest one." must refer to the initial ordering that was based on t1. namely the letter associated with each asteroid
densch: so if like C and G would land on the same point, the letter C would be placed on that coordinate in the t3 picture. -.-
densch: sometimes I'm thinking too much into things
densch: where the observation point is doesnt matter in the slightest -.-
PatrickMcGinnisII: I guess it
PatrickMcGinnisII: s a vector mathat thing, point direction
densch: well, yeah, I totally expect the asteroid to keep flying along the line indicated by the change between picture a and b. so traveling in the same direction vector wise
densch: this thing is more about math tha actual programming :-D
PatrickMcGinnisII: nx=x1+(dx/(t2-t1)(t3-t1)) ... dont forget to round down
densch: good old (int) will do the job for me. will kepp stuff doubles until I calculate the final t3 x and y coordinates
densch: int+int*double should automatically be calculated as double values, right? like, without any casting written there?
PatrickMcGinnisII: depends on language, in general yes ... but warning or error may appear
jacek: += would automatically cast to variable type
Chainman: hello world
Chainman: how do you do 10 clashes but be rank 22 in coc?
Chainman: :rofl:
UncertainLeo: coc but with a k at the end
jacek: oO
Chainman: :thinking:
-oa-: :bird:
Manchi_o6o7: the best way to understand graphs and adjacency lists in C is ________?
reCurse: reading
Nerchio: :joy_cat:
Chainman: :nerd:
Westicles: do the skynet puzzles
xNotAHackerx: hey programmers... how much do you make on average?
reCurse: https://www.levels.fyi/
Westicles: 25 schmeckles per line
Lucky30_: 0
sbdm666: yo
sbdm666: bois hows it going
Chainman: fine
AntiSquid: 900k / year ? cost of living must be through the roof too
Nath1325: hi how can I challenge a friend plz
Chainman: in MCTS what should be the value of a node? the winrate?
ZarthaxX: you can check that on papers
ZarthaxX: but yeah, that can be
ZarthaxX: the stadistics of the winrate
Chainman: like (number wins)/total visits
Chainman: that seems to be what the paper is doing
Marchete: it depends
Marchete: that's a part
Marchete: SumScore and visits
Chainman: actually says total visits/number wins
Marchete: are used on SelecT()
Marchete: it's part of the UCT
Marchete: but when you end your search, in theory you just pick the most visited
AntiSquid: there are more than 1 MCTS variants Chainman
Chainman: I think that was a mistake in the article though
Chainman: I saw (total visits)/(number wins)
Chainman: but another article uses w/n
Chainman: (number wins)/(total visits) which makes sense
Nerchio: doesn't matter which metric i use it never works
AntiSquid: what have you tried out Nerchio ?
Marchete: it's (number wins) if your losses are 0.0
Marchete: it should be sumScore
Nerchio: basic MCTS with UCT formula
Nerchio: but yeah i need to give it another go :D
Marchete: as score is -1,0,+1
Marchete: MCTS is tricky with UCT formula
Marchete: you need a balance between the two parts
Nerchio: i tried UTTT maybe that was one of the problems lol
AntiSquid: hard to debug
Chainman: I'm just doing TTT as a starter
Nerchio: yeah my bot is in bronze with MCTS
Nerchio: :D
Marchete: debug a lot
Marchete: see first levels of the tree
Marchete: visits, UCT parts per children
Marchete: etc
Marchete: to guess what can be wrong
AntiSquid: i have problems evaluating opp properly
Nerchio: i will rewrite it from scratch for the 3rd time
Nerchio: but not my first plan :D
Chainman: I created an MCTS for TTT I think lol.
Chainman: idk I'd have to code TTT game for testing it though.
ZarthaxX: that's easy
ZarthaxX: you can use an online TTT
ZarthaxX: or play against it manually :P
ZarthaxX: no need for making the game yourself
izanbf: Hello ZarthaxX
ZarthaxX: :O izanbf :*
Chainman: I guess and manually input states and let is run the search.
izanbf: Hahaha how are you doing? Lot of time has passed
memcorrupt: https://escape.codingame.com/?fromToken=C12-6FP-itS-dKq
memcorrupt: can someone use my link :(
memcorrupt: im #15 on the list
Chainman: how's going guys?
Chainman: Oh I should reuse my tree for mcts. :grimacing:
struct: I think so
struct: I currently dont do it
struct: But I think top players do
Chainman: oh really?
memcorrupt: do private clash of code games raise ranking
Chainman: cause for TTT, I just thought if I already have a state existing, why not just start from there later instead of recreating the tree.
Chainman: Cause everything beneath that node should still be true
struct: yes thats what i said
struct: :p
Chainman: when?
Chainman: I'll need to hash my nodes to do something like that I think.
Chainman: so I can quickly start from a node
struct: you dont need that
struct: you can just check the move
struct: and pick the node that had that move
Chainman: I'd have to check the move that the human makes too
struct: yeah
Chainman: cause I was going to play against my bot at start lol
Chainman: before having it play itself idk
Chainman: might not do that tbh
Chainman: nah it's harder you are right to propagate it back up the mcts.
Chainman: I mean if I reuse the tree
padobranac: great
Fafar: why if i print in a clash of code, the thest found nothing?
padobranac: finally got into top 2% for bot programming but cant progress on the AI quest map...
padobranac: @fafar maybe your code was not executed
padobranac: but more likely the program expects you to print more than one line
padobranac: so for the second line it says it found nothing
Fafar: i think this is ok but idk
Greg_3141: my guess is that the quest map and the leaderboard define "top 2 percent" differently due to rounding
padobranac: thanks greg but thats not it. I actually made it to 0.9% so rounding wouldnt have made a difference.
padobranac: there seems to be a lag between the quest and ranking
padobranac: it came trough just now
ElJoe2: are clash of code's exercises worth it?
ElJoe2: i think they're filled with ai
padobranac: nah
padobranac: no ai in CoC
padobranac: mostly simple maths/physics or working out relationships between input and output
padobranac: they are good little puzzles
padobranac: i enjpy them but depends what you are trying to get out of them
hexa8: Sup
Chainman: okay my mcts for TTT seems to be working
Greg_3141: I wish leetcode supported more languages
Chainman: meow
hexa8: woof
Chainman: hmmm my mcts for TTT is worse than me. I can beat it so easily.
Chainman: I even try letting it win, and everytime it choose to block me and end in tie instead of winning lol
Chainman: basically it avoid winning two times I gave it a chance.
struct: so its bugged
Chainman: I wonder if I shouldn't increase winrate for draws lol
Chainman: It is going for draws too much
Chainman: but Idk how it let me win once though
Chainman: that's just bad
Chainman: not sure what to put for exploitation constant, I tried 1.4,2,3
struct: ok I thought I had a bug but I dont have
struct: Chainman if its not bugged
struct: 1.0 exploration should work
Chainman: You have a bug?
Wontonimo: is your constant in or out of the sqrt?
Chainman: outside
struct: No, I thought I had
Wontonimo: and is your reward 0,.5,1 or -1,0,1 ?
struct: Chainman how many states do you get
struct: if you let the tree fully expand?
Wontonimo: and are you able to print out the first level of your tree with numVisits and totalReward? It can really help identify what's happening.
struct: I mean nodes*
struct: fully expanded tree should be 549945 nodes
Wontonimo: if your constant is too high, all nodes will have the same numVisits, too low and just the first okay one it finds will have 90% + the visits
Wontonimo: of the first move
struct: yeah, I think he should increase exploration
struct: just to check if the tree expanded returns the same number
Wontonimo: :thumbsup:
struct: I thought the number was less
struct: because I was checking wiki
Chainman: Wontonimo I have -1,0,1
struct: But the correct number is indeed 549945
Chainman: actually I have -1,1,1
Chainman: I just threw draw/win together
Wontonimo: change that if you can. MCTS will try to fit your model, and if your model isn't real then it will play the wrong game.
Chainman: oh oops
Chainman: I was actually adding 0 for a lose
Chainman: It's doing 50k iterations
Chainman: supposed
Chainman: anyway I updated my rewards to -1,0.5,1 but I just beat it lol
Chainman: with exploration_constant at 1
Wontonimo: why 0.5 for a tie?
Wontonimo: try [-1,0,1] for the rewards and an exploration constant of 4. If that doesn't win TTT, then there is definitely a bug, maybe in your backprop. Do you flip the reward during backprop?
Chainman: okay I print data from the root node of the tree.
Chainman: so there are 50k visits as expected with 50k iterations.
Chainman: although not sure how many states are created
Chainman: the reward to root is -38374 lol
Chainman: I did 0.5 for tie, cause I thought it is better to tie than lose
Chainman: cause in TTT it is abnormal to actually win, most games are tie if both play optimal
Wontonimo: it is, that is why it is 0 and not -1 :D
Wontonimo: If i win 1 game and you tie 3, do you win over all? with 1,0.5,-1 for your reward you will think you will.
Chainman: I try that, I'm beating him easily lol :(
Chainman: maybe I need to check number of states,
Chainman: the reward grows very large quick for the root, it is -100k after the 2nd turn.
Chainman: I mean grows small*
Chainman: seems he is finding lot more losses than wins somehow
Chainman: wth
Wontonimo: you may be attributing the win/loss to the opposite player by accident
Wontonimo: g'night. I'm out
struct: gn