Danyosate: it's the order of the input, really stupid
Danyosate: u have to deal with the order manually
Elioh: anyone here good at both python and java ?
eulerscheZahl: just ask your question and find out if we are good enough
Elioh: hahahaha true
Elioh: i am studying java for an entrance exam into a company :p
Elioh: wanted to see if anyone has any tips for the switch between the languages
Uljahn: i don't know java very well but often can rewrite java to python just by deleting "unnecessary" things :smiley:
eulerscheZahl: but deleting is easier than adding to go in the opposite direction :P
amurushkin: I think i see somewhere like a tips to rewrite the code between languages but the best way on my opinion is to know the both
Uljahn: sure thing
Elioh: yeah im gonna start practicing it from 0
Elioh: thanks guys !
kovi: was there any change in BandC validators?
kovi: few days ago the first few submissions of my new code gave 2x304. but since i rarely get below 310
dbdr: kovi: I don't know
dbdr: wlesavo: are you there?
dbdr: see kovi's question above
wlesavo: no, didnt change a thing
wlesavo: would do so without discussing here anyway
wlesavo: kovi i guess this is why dbdr was wondering if you are doing anything fancy :slight_smile:
dbdr: wlesavo why aren't you at 100%? ;)
wlesavo: because im bad at programming :slight_smile:
dbdr: good enough to make contributions
wlesavo: im getting a lot of fan recently on hard and very hard puzzles but cant optimize BC
dbdr: but yeah, that's different skills
dbdr: definitely harder in python
dbdr: you must know Java, that would be much faster
wlesavo: yeah, i tried to vectorize my code with numpy, but still cant generate initial pool fast enough
dbdr: top 9 is C/C++/Rust
dbdr: then Python and Ruby :D
wlesavo: i think what we really should do is decide the tie between 2-3-4 :slight_smile:
dbdr: I think CG is doing the right thing: display ranked by submit time, but equal CPs
dbdr: that said, good if someone improves :)
wlesavo: well that makes sense
dbdr: for years it was the (wrong) opposite: random ranking changing over time and which gave different CPs :D
dbdr: I guess they could still improve. Print:
dbdr: 2 " " 5
dbdr: instead of: http://chat.codingame.com/pastebin/eb0fc15e-d3c6-44ba-8d84-be58c735efff
wlesavo: oh really? it was random?
dbdr: yeah. I think they just used sort on the score
wlesavo: as for me ill probably stick to some suboptimal strategy and will be happy with just 100% :slight_smile:
dbdr: I'm not even sure how to do it suboptimally
dbdr: do you?
wlesavo: yeah, after finding all digits you can just swap 2 of them and see if this increases bulls count, smth like that, or eulers rotating tail strategy
dbdr: some, some kind of hill cimbing should work
wlesavo: also when you definitely know 4 digits you can implement same strategy as before
dbdr: generate all combinations?
dbdr: right. won't work with N=10 :D
wlesavo: that works for me in 50 ms for length 6
dbdr: yay for exponentials :)
wlesavo: cant get below 10s for L=10 though
dbdr: N = 10 => 3265920 possible guesses found in 153.6ms
wlesavo: well i could count all bulls in every permutation in around 1s, but thats was with a method which couldnt keep track for the guesses itself, just some kind of index
wlesavo: dbdr what do you use to generate guesses? standard tools, couple of loops or something really different?
dbdr: a recursive function that fills a vector
wlesavo: seems slow for python, hm
wlesavo: easy to implement though
R4ID3N: hi guys.. keep safe
R4ID3N: wear mask always
ASC_alpha: thanks for the tip
kovi: dbdr, do you still have chat logger/search site?
kovi: cg chat
qlorg: Hi guys
struct: Is this page not working for anyone else
MadKnight: what u mean by not working
struct: The page loads, but it doesnt load the functions
struct: This happens to me
struct: It happens to me in all browser
struct: even on mobile
Wyseh: When I go on it I see a list of functions
struct: why doesnt it load for me :(
Wyseh: it's weird, btw i'm using opera
Wyseh: Worked on chrome as well
qlorg: Hi guys
ScottyTeey: Hi guys!
ScottyTeey: Name is Scot, i am a Junior developer and i am looking forward to go through this journey with you
Uljahn: it's dangerous to go alone! take Automaton2000 with you
Automaton2000: i am a bit confused
MadKnight: Automaton2000 is the cool one here
Automaton2000: oh you mean the overly pretentious description on the menu to make the code so i can write it
Automaton2000: is that a bad idea?
m1.late: just an amazing coder
m1.late: i hit lvl 15!
The-White-Fang: hey, so i'm a little lost on this puzzle https://www.codingame.com/ide/puzzle/short-accounts-make-long-friends if someone could explain or guide me to the right direction, I'll be really thankful
struct: Trying all combos is not enough?=
Scarfield: You can add/subtract/multiply and or divide the numbers given, to try and reach the expected result, what are you in doubt of The-White-Fang?
Scarfield: Output Line 1: POSSIBLE or IMPOSSIBLE whether the operation is possible or not Line 2: min distance from result if the expected result is impossible to obtain or minimal number of operations if the expected result is possible to achieve
Scarfield: Msmits; for the smitsi UCB calc, is the scale parameter really necessary? wouldnt it be enough to fit the exploration parameter according to the range of ones score range?
struct: He doesnt use the it anymore
Scarfield: yea thought i remembered that is what he mentioned he changed, but i cant remember what he does instead :p
struct: He didnt exactly say
struct: but he also said that he can share it
Scarfield: it seems to me, that fitting the exploration param would yield the same?
struct: I think so
struct: but in some games you might need to ajust it depending on turn
struct: Also depends on eval
struct: on CSB it would make no sence to not change exploration parameter
Scarfield: noice ty, hopefully i can start testing the search tomorrow :) hows your smitsi going?
struct: just starting now
Scarfield: gl :muscle:
struct: also I need to ask him
struct: if he has different exploration parameter
struct: based on pod
Scarfield: hmm didnt think of that, could be the blocker would benefit from exploring more/less. Good idea :)
Scarfield: I will try without assigning a role for the pods initially, and hopefully the roles will emerge from the search, but its possibly a bad idea
struct: I think it should
struct: Never asked m smits
MSmits: i dont
MSmits: but it's not a bad idea.... there are many things I never tried
Scarfield: i suppose it matters more if there are other pods close to one of your pods. If one of your pods has both enemy pods close, it would probably benefit from more exploration
MSmits: hard to define "closé". If your search has a depth of 7, anything could be close at some point
Scarfield: well, the more likely a collision is, the less certain the search is i mean
Scarfield: btw, cant you neglect the scaleParam and instead fit the explorationParam for the range of your eval score MSmits?
Scarfield: in smitsi that is
MSmits: of course, I said this twice on chat over the last few days :P
MSmits: rambled on about it for half an hour one time :P
MSmits: I dont have a scale parameter anymore
Scarfield: I have been raiding in Escape from Tarkov way too much lately :p
MSmits: it's too slow
struct: do you have different exploration param per pod
MSmits: I thought I put this in my article. Didnt do a rewrite, just a comment
Scarfield: 2 sec
MSmits: both pods will have a similar score range
MSmits: so i didnt bother to fit them separately
MSmits: btw, you can also have pods share a single node
MSmits: then you'd have 10-20 moves on expansion
MSmits: if you prune properly that is
struct: but does your exploration param change throughout the game?
Scarfield: hmm i dont see any comment about it, but you mention Robo suggested a random rollout
MSmits: i dont use that way, but I've heard it being used before
MSmits: my version uses a random rollout, to make sure each rollout goes to depth 7
MSmits: the first few expansions it doesnt go deep enough otherwise
MSmits: it barely matters though
MSmits: without the random rollout it performed almost the same
MSmits: struct, it does not change
Scarfield: "NOTE: I have changed my CSB bot to no longer use the lowestscore/highestscore normalization method as it was kind of heavy. It makes sense to start with something like this though."
struct: ok so i have no clue what you do
MSmits: yes, it makes sense because you then dont need to fit it in a reasonable range
struct: but wait
Scarfield: ah you did, just scrolled to the part i needed, read it a few times by now :)
struct: So its in your eval
MSmits: without scaling, your exploration param could be anything
MSmits: will be very hard to guess a good value without scaling
struct: I cant use Magu s eval on CSB for runner
MSmits: not sure what that is
struct: and not change exploration param if I dont have the scale
MSmits: you dont need scale
struct: return checked*50000 - this.distance(this.checkpoint());
MSmits: ok do it like this
MSmits: pick any exploration param
MSmits: finish bot
MSmits: out put the first child nodes you can choose as moves
MSmits: if they have all visits on 1 node, your exp par is too small
MSmits: if all nodes have the same amount of visits, your exp par is too large
MSmits: get somewhere between those extremes and do a proper fit later
struct: But example
struct: on magu s eval
struct: the further the game goes
struct: the bigger is the score
MSmits: doesnt matter
MSmits: ok, you've played uttt right?
MSmits: I an use it as an example
MSmits: what are you loss and win scores
MSmits: -1 and 1?
MSmits: or 0 and 1?
MSmits: I need to know to give an example
struct: let me check
struct: cant recall
MSmits: doesnt matter
MSmits: just pick one
MSmits: no need to go check
struct: -1 1
MSmits: what will happen to your bot if you changed that to
MSmits: 12456 and 12458
Scarfield: My thinking was: http://chat.codingame.com/pastebin/9b0b5e4c-6cf9-4d32-bff8-f4b2a246fcd9
MSmits: for loss and win
struct: if i didint change exploration?
MSmits: well maybe not quite that large due to floating point precision, but say you have 123 and 125
MSmits: yes struct
MSmits: if you kept exploration the same
struct: i guess it would explore a lot more?
MSmits: it will play exactly the same
MSmits: the differences in average score between two child nodes will be the same
MSmits: a child that always wins has 125
MSmits: a child that always loses has 123
MSmits: so the value term in UCB1 has the same difference
MSmits: between the two children
MSmits: so selection is unaffected
struct: I see
MSmits: so you see now why it matters not that you use magus eval?
struct: But what does exploration param do then?
MSmits: the fact that you are late in the game is a score bonus for every node
struct: allow to explore more?
MSmits: it affects the ratio between the value term and the exploration term
MSmits: i should say value term differences
MSmits: the spread
MSmits: with a larger exploration parameter, visits begin to matter more
MSmits: let me do another example
MSmits: ok so you have -1 and +1 for uttt
MSmits: what would change about your bot if you changed that to -100 and +100
Scarfield: its a balance value, to make your terms in perfect balance, as all things should be...
MSmits: and you made your exploration parameter 10x as high
MSmits: 100x sorry
MSmits: say it was 1.3 before, it is now 130
MSmits: -100 loss, +100 win, 130 exploration parameter
MSmits: it would be exactly the same bot
Scarfield: isnt it the range of the score, more than the score "value" ?
MSmits: the range of scores among the children
Scarfield: noice, i think i got it :D
MSmits: it pays to really look mathematically at the ucb1 formula
struct: Ok I need to test this
Scarfield: yea, and realise that its comparing the different UCBs and not only one UCB result that matters
MSmits: ok so do two things. 1) Multiply loss score, win score and exp param by the same amount
MSmits: and 2) add a fixed score to both loss and win and keep exp par the same
MSmits: both those two experiments should do nothing
MSmits: right Scarfield
struct: Multiply by what?
MSmits: a positive number
MSmits: say, 10
MSmits: so win = 10, loss = 10, exp param is 10x what it was
MSmits: loss = -10
kingofnumbers: MSmits I see that you are very active on this chat :D
Scarfield: in completely different news: i searched for your article earlier, and one of the google results was something like "Jimmy Smits: IMAX ... " xD
MSmits: kingofnumbers you see correctly :)
kingofnumbers: what's the reason?
struct: my exploration param is 1 in UTTT
MSmits: that i am active?
struct: why do I even have it
AntiSquid: actually MSmits has 6 siblings, that's why kingofnumbers
MSmits: yes we use UCB1 to pick who has chat duty
kingofnumbers: yes, that you're active
kingofnumbers: a messaged in red means it's private?
MSmits: well I like talking about this stuff I suppose
MSmits: it means they talk to you
AntiSquid: red = hot
MSmits: type msm and press tab
Scarfield: kingofnumbers it means your name was mentioned
kingofnumbers: MSmits hello
MSmits: the name will finish and it will ping
MSmits: yeah like that
kingofnumbers: so if first word is nickname it will appear red?
MSmits: no, any word
MSmits: lool: kingofnumbers
MSmits: it always works
AntiSquid: it will also send a loud and annoying ping to the user you mention and alert them you are demanding an immediate response
kingofnumbers: so if my nickname in the message it will appear red?
MSmits: you can also ping Automaton2000
Automaton2000: there was a lot more than i do
MSmits: to you yes kingofnumbers
kingofnumbers: were you guys talking about reinforcement learning stuff?
AntiSquid: Automaton2000 i'm thinking to kick you so you can self-isolate
Automaton2000: but i wanted to test it
MSmits: kingofnumbers nope
MSmits: just the ucb1 formula used in mcts and other things
MSmits: but people talk about machine learning here often
kingofnumbers: what is mcts ?
Scarfield: monte carlo tree search
MSmits: used often in AI for board games
MSmits: sometimes combined with machine learning
kingofnumbers: I think this is very relevant to reinforcement learning
MSmits: sure yes
MSmits: I need to grade tests =/
MSmits: One problem with working solely from home is that you can always work
MSmits: have to know when to decide to relax and do something else
struct: cant you just keep your usual work schedule
MSmits: I think i should work on my Onitama bot now
MSmits: I didnt have much of a schedule to begin with, but over half the work i did at my school and i graded tests in the train
MSmits: both those things are different now. Need to find a new balance
eulerscheZahl: onitama sounds good
MSmits: yeah, I figured out how to code a bitboard. It's all in my head. Now I need to type it up
MSmits: and cause lots of bugs
kingofnumbers: MSmits are you active in competitive programming like codeforces etc?
MSmits: not like codeforces
eulerscheZahl: not writing a simple bot first and extend it slowly (eval changes might be faster without bitboards) you do all at once :D
kingofnumbers: so only AI stuff?
eulerscheZahl: faster to implement i mean
eulerscheZahl: he's not on codeforces
MSmits: it's not that much harder to do a bitboard since I am used to it now, but i got stuck on 1 thing
MSmits: I always start like this: I do one expansion (of the root) and apply a random child move, remember the tree between turns
MSmits: thats the perfect test of the sim
MSmits: and the bitboard is confined to the sim
MSmits: so if that works, then it's all fine
MSmits: i said that wrong, i mean i expand once, print the result after the move and check if its the same as the actual game state
MSmits: do it for a whole game, every turn
MSmits: the rest of the bot is not much work, i just steal it from a different mcts bot
MSmits: kingofnumbers yeah, we have many multiplayer arena's and sometimes we have a 10 day contest
darkhorse64: MSmits: I feel like you are reading my code over my shoulder
MSmits: you and I do almost the same thing I think.
MSmits: some small differences
darkhorse64: You hacker !
MSmits: what you said about your idea for onitama was also in my head
AntiSquid: he also reads your love letters, he posted them in chat the other day
MSmits: i just couldnt figure out how to do the cards
MSmits: lol AntiSquid
darkhorse64: I still need to code the lookup for card moves. Despite the lockup, I have been very busy lately
MSmits: yeah the lockup keeps me busier than I thought it would also
MSmits: i bet we'll both kick trictrac off nr 1
MSmits: well down to 3 I mean
MSmits: from what I read you're going to do the exact same bot I am
MSmits: I am thinking about eval vs random rollouts though
MSmits: seems there are few features you can use for early playout termination
MSmits: also games will be shorter so..
eulerscheZahl: trictrac and jacek are both pretty strong
MSmits: yes, but I can beat them both with sheer arrogance and overconfidence
darkhorse64: That's the goal. It will be true only if Onitama is not a trap game
AntiSquid: what do you mean by trap ?
MSmits: narrow lines of play that lead to a different result than the average result from nearby branches
MSmits: so an "average" game state does not apply
darkhorse64: typing too fast for me. +1
MSmits: and you can't value nodes properly
struct: by trap he means yavalath
darkhorse64: Very good example where the random rollouts leads nowhere
MSmits: might be true for onitama also
MSmits: however, early playout termination should have no weaknesses compared to minimax should it?
MSmits: you just need a good eval
MSmits: like minimax
MSmits: not that that is easy
MSmits: all I can think of is number of live warriors
MSmits: maybe nearness of master to opponent shrine, but with weird card jumps that could be meaningless
MSmits: help us out here eulerscheZahl :)
MSmits: pretty sure you thought this through
eulerscheZahl: closeness of your units
MSmits: is it good to have them close?
eulerscheZahl: if 1 gets captured, you can fight back
MSmits: do you look at the cards for this?
darkhorse64: Another feature is number of possible moves
eulerscheZahl: personally i don't but my bot is bad
MSmits: could just be performance, or did you c++ this?
darkhorse64: If a piece is close to the rim, it has less freedom
eulerscheZahl: number of possible moves is a good one i think
eulerscheZahl: (i don't do it)
MSmits: i would say threatened squares
MSmits: which is almost the same as movement freedom
MSmits: except you count two pieces threatening the same square as 1
eulerscheZahl: protected units
MSmits: plenty of ideas to try
MSmits: give me a week to get this to work though. As you said, i do it all at once
darkhorse64: First reach 1 M sims, after we can talk
MSmits: 1M... euler didnt give us a 1s start
darkhorse64: Really ?
eulerscheZahl: you always have 1s
MSmits: really !?
eulerscheZahl: i can't even do anything to prevent it, if i want
eulerscheZahl: setup time for slower languages
MSmits: thats good to know
eulerscheZahl: some really need it there isn't a single game on CG without that 1s
eulerscheZahl: so i was too lazy to explicitly mention it
MSmits: makes sense
MSmits: about the 1s I mean, not you being lazy
struct: but can you make it 2 sec?
darkhorse64: Great, compute the game to the end. That makes me think that some cards decks lead to a forced win. That's another good test to run
MSmits: trictrac did that
MSmits: euler blacklisted card combos that were easily solvable
MSmits: eulerscheZahl, could you expand the blacklist further if I happen to solve more?
darkhorse64: Don't tell !
karliso: onitama has 1s for 1st move?
MSmits: darkhorse64 there are 300k + combos
eulerscheZahl: there was a post on boardgame geeks about the blacklist too
eulerscheZahl: some games can be solved in 6 turns (these are excluded)
MSmits: but what if one can be solved in 10?
eulerscheZahl: seems that there are no further solved games with up to 8 turns
eulerscheZahl: or even 10, i don't remember
MSmits: ah ok
darkhorse64: I mean check a few blacklisted combos against your engine as a test
MSmits: well if someone did good research on this, i dont have to
AntiSquid: karliso what's your secret sauce?
karliso: Ask MSmits a lot of questions.
MSmits: he did do that :)
MSmits: and now I am nr 2 uttt
AntiSquid: brain draining MSmits :thinking:
MSmits: it's amazing how fast karliso learns
AntiSquid: using MSmits as open book :thinking:
eulerscheZahl: i think it was https://boardgamegeek.com/thread/1548732/extensive-analysis-quick-forced-wins
struct: before I work on my smitsi
struct: I must work on my MCTS performance
struct: need to be fast
eulerscheZahl: afaik i use the USA version (with the smallest amount of easy wins)
AntiSquid: there's no rush
MSmits: the strength of onitama is the random card-start
struct: if I did avx sim
struct: now I need mcts that matches
MSmits: 300k+ makes it impossible to add an opening book
eulerscheZahl: i know :)
MSmits: so it doesnt matter if people can solve it locally
MSmits: I can probably find many combinations i can solve locally, but not in 1s
MSmits: if i do, i will let you know
eulerscheZahl: i was very well aware of how hard it will be to add an opening book, when i decided to create the game :imp:
MSmits: yeah, it's good
MSmits: I dont need all games to be book-able
MSmits: I can only run 1 meta mcts at once :)
struct: how many cores you use?
MSmits: just 1, i have a quad core pc, but I want to be able to do other stuff on it
MSmits: I sometimes ran two meta mcts
MSmits: but I paused yavalath
darkhorse64: Change the priority
MSmits: It would make a lot of sense to do one for oware and checkers
MSmits: but checkers doesnt motivate me and oware.... meh at some point maybe
MSmits: for breakthrough it is almost impossible I think
MSmits: you can make an openin book that is really good vs yourself, but if you play against someone who uses a different strategy it becomes useless
AntiSquid: Ciomegu no need to brag about it
struct: Automaton2000 how are you?
Automaton2000: you are still in the same order
elderlybeginner: any hints for puzzle of the week?
Uljahn: brute force it, Automaton2000
Automaton2000: and if it's a problem with it
elderlybeginner: https://imgur.com/gezkisX.png found in in notifications
Uljahn: JBM just solve all the puzzles and one of them should be it :smiley:
elderlybeginner: what's Automation2000? :grin:
Uljahn: you mean Automaton2000? :wink:
Automaton2000: u need to pass the validators
Scarfield: Automaton is a chat bot
Uljahn: also use tab to autocomplete long nicks
Scarfield: In the puzzle you need to see if you can reach the target result with doing the allowed operations (+, -, *, /) on the given numbers
elderlybeginner: yep, any other strategy for that puzzle beside brute force?
Scarfield: if you can, output possible, and the number of operations needed, if not, output impossible, and the difference between the target number, and the closests number you can reach - so as mentioned, bruteforce is the way
Uljahn: doing brute force in python could lead to timeouts though
Scarfield: hmm, dont think so, but have only read the description, havent looked at it more than that
Uljahn: me too
Scarfield: isnt there a full second available for puzzles?
elderlybeginner: there are 14 numbers available, 6 places, then you have combination 6 out of 14, and additional combination or permutation for operators. It seems to me that it makes a lot of computing
Scarfield: oh there is a constraint i didnt notice, there is only a few possible numbers you can get as input, not all from 1 to 100, so there might be some strategy from that, also the target is less than 1000, so that also limits a lot
struct: some puzles even get more time
struct: based on language
struct: but not on c++
struct: Dont know if this applies to all puzzles
elderlybeginner: second example looks like there is a cue in it, however I cannot see it :shrugging_man:
Scarfield: with one number you can do 4 operations with any of the remaining 5. 4 * 5 = 20. Then 4 operations with that result with the remaining 4 numbers, and so on.. Then if the result can be reached without using up all numbers given, you need to start with all six, which should mean: (4*5)*(4*4)*(4*3)*(4*2)*(4*1)*6 = 737.280 permutations
Scarfield: that should be doable in python i think :)
struct: depends on time I guess
elderlybeginner: this does not include operations on results of the first operations
Scarfield: yes, thats why the parenthases are multiplied as well
struct: also the number wont be that big
struct: since if negative
struct: you can ignore
struct: at least is what I understood from the quick read
Scarfield: Only subtractions resulting in a positive number are considered. Only divisions resulting in an integer are considered. yea there is some constraints on that as well
elderlybeginner: it should be combination in parenthasis then, (C(6,2))
elderlybeginner: or permutation if the numbers can be repeated - no info about that
Scarfield: that actually isnt mentioned, but it seems implied that one number can only be used once
Scarfield: if numbers can be repeated it should be (4*6)^6 which i doubt
struct: it is in 50 days