Chat:World/2021-08-21
eulerscheZahl: indents with only 2 spaces? barbaric
Zachiah: Great job using exit! I didn't really have that in javascript so I think that's why mine was longer in that last challenge
BlaiseEbuth: Yeah! GG! :tada:
BlaiseEbuth: Wrong chat dude.
masongtxr: hi
masongtxr: help me
masongtxr: i'm stuck in CSB
BlaiseEbuth: Here we are...
masongtxr: what
Westicles: heh heh
hinammmm: do u know a forum of whitehat>
masongtxr: no
masongtxr: answer me please
BlaiseEbuth: To what question?
masongtxr: CSB
masongtxr: wood 3
hinammmm: can someone give me some forum of whitehat?
AlanSpacer: You can find white hats in almost every clothing store
hinammmm: not funny
akhil2310: https://www.whitehatjr.com/
Lekrkutj: for (let i = a; a <= i >= b; i++) {
Lekrkutj: why this doesnt work
AlanSpacer: you wrote it out too mathematically
AlanSpacer: a <= i && i >= b is probably what you mea
AlanSpacer: n
AlanSpacer: However, that looks wrong anyway
juice0: do you want i to be between a and b?
LemonPi314: a <= i && i <= b if the answer to juice0's questions is yes
Lekrkutj: yeah i wanted it to be between a and b
Lekrkutj: to much of a mathemician apparently
KpskyVnzt: if you want it btw 'a' and 'b' then use ( i=a; i<=b ; i++)
dctrdee: how do you use regexes in replace in c#?
JennieRuby: https://docs.microsoft.com/en-us/dotnet/api/system.text.regularexpressions.regex.replace?view=net-5.0
Panavia_tornado: How to find a functional to maximize the difference between troops in ghost in cells? (Parameters - sending troops from any of my cities to any other)
Panavia_tornado: due to the huge number of possible armies in the process of movement, it is not entirely clear how to simulate production in cities in a reasonable time
eulerscheZahl: https://www.codingame.com/forum/t/ghost-in-the-cell-feedback-strategy/2634 there are lots of writeups that tell you how Panavia_tornado
Kovac7: Is there a way to make the ide light mode or is it dark only
BlaiseEbuth: :scream:
martinpapa69: :yin_yang:
TobiasA: :fearful:
borrel: click settings on the right
TobiasA: Nothing hurts more than being 1st in a league and yet still being below the boss
TobiasA: I'd rather be last in a higher league:unamused:
martinpapa69: :broken_heart:
TobiasA: has anyone reached gold with flat MC in uttt so I can know what is possible and what isn't
martinpapa69: why would you do mc in uttt :thinking:
TobiasA: :scream:
martinpapa69: mc is not 1v1 friendly
TobiasA: I wasted my time
martinpapa69: not rly you have a sim i guess
martinpapa69: so you can build an mcts around it
TobiasA: if it isn't 1v1 friendly then where is it used mostly?
martinpapa69: 1 vs env
TobiasA: got it thanks
eulerscheZahl: "has anyone reached gold with flat MC in uttt " yes, I did
eulerscheZahl: then MCTS for legend
TobiasA: :0
TobiasA: hi xpman
TobiasA: how did you do it eulerscheZahl
eulerscheZahl: for each first move:
run sequence of fully random moves until the end
eulerscheZahl: repeat as long as there is time
eulerscheZahl: take the first move that gives the most wins
eulerscheZahl: won't get you into legend but good enough to destroy silver
TobiasA: i did that too but it only got me too 1st in silver but still below the bos:disappointed_relieved:
TobiasA: *boss
eulerscheZahl: then you need more sims
TobiasA: how do i get more sims?
eulerscheZahl: i don't even know your current amount
eulerscheZahl: how many rollouts at the start of the game? (at 90ms)
TobiasA: dunno:sweat_smile:
TobiasA: lemme check
TobiasA: do you mean the number of steps to get to a terminal node or number of times that process was performed?
eulerscheZahl: the latter
eulerscheZahl: i'll just put up this number: 5k full rollouts at turn 1 (90ms) with MC will get you to gold easily
TobiasA: 4293
TobiasA: that's what i'm getting
eulerscheZahl: sounds good enough
martinpapa69: fix your sim
TobiasA: it works fine though
TobiasA: guess i have no choice but to use MCTS but the thing is if MCTS gets me to gold but not legend i won't know what else to do
martinpapa69: building an mcts on a buggy code doesnt sound like a good idea
TobiasA: if only i knew what the problem was
TimothyAlexisVass: Hello sarabelforte
TimothyAlexisVass: How are you?
sarabelforte: im fine thanks im a total beginner in codding
TimothyAlexisVass: Oh
TimothyAlexisVass: Hey guys, how is it possible to have played over 100,000 clashes or even played over 100,000 clashes and have a Score around 10-12?
TimothyAlexisVass: Are there bots in the Clashes? :\
jacek: TobiasA you can make sims more smart. i.e. make moves that win small board more probable
TimothyAlexisVass: Just read about it and yes, there are bots... "This account is a CodinGame bot for Clash of Code.
Discover why we added it and how it works here: https://www.codingame.com/blog/clash-of-code-time-has-come-for-clash/"
TobiasA: that was what got me from second to first in silver
ProCoder03: I did a Flat MC which performed well in Wood, but when I just simply added the code for 3x3 small boards , I am only in top 100s
TobiasA: but wontonimo said % is very slow
ProCoder03: is it a problem with my sims ??
TobiasA: and i have a lot of %:sweat_smile:
ProCoder03: what do you mean by '%' ??
Netsos: cal
TobiasA: modulus
TobiasA: top 100 of what league?
ProCoder03: bronze
ProCoder03: I tried MCTS now
ProCoder03: top 1000
TobiasA: bruh
TobiasA: that's scary
ProCoder03: the prob is my MCTS does some invalid moves
TobiasA: i guess the problem is from your sim
ProCoder03: yeah ik, I just can't find it
ProCoder03: it seems there is a prob with my Main board class , urgghhh
TobiasA: i feel your struggles
TobiasA: good luck on finding the problem
ProCoder03: performance wise , MCTS is good, I usually get around 4000 rollouts for 1st move with flat MC but i can go up to 8000 rollouts in MCTS
ProCoder03: Thanks :smiley:
TobiasA: time to go modulus hunting:muscle:
TimothyAlexisVass: Have you learned anything yet sara?
Wontonimo: modulus is very slow compared to addition, bit it isn't so bad as to avoid it at all cost. If it makes sense to use it and changing it out for something else doesn't improve sims/turn, use modulus
Wontonimo: if you need to do x%9, do it. if you need to do x%16, try instead x&0b1111
ja_fica: you can avoid using muduls
ja_fica: *modulus
ja_fica: in every number
Wontonimo: example of modulus 9 plz
ja_fica: https://aipuzzles.com/learn/performance
ja_fica: random generator section
ja_fica: using shifts
ja_fica: you can go ahead and implement it in your algorithms, thank me later
jacek: considering number generation is your bottleneck
Wontonimo: that's good for rand
ja_fica: ((number >> 16) * mod) >> 16
ja_fica: using uint32_t
Wontonimo: yeah, i know that trick
ja_fica: it works as long as the number is smaller than 2^16
ja_fica: you can do in 64 bits
ja_fica: ((number >> 32) * mod) >> 32
ja_fica: using uint64_t
Wontonimo: sure, but it doesn't do 32%9
ja_fica: sure it does
Wontonimo: ?
ja_fica: ((32 >> 16) * mod) >> 16
ja_fica: ((32 >> 16) * 9) >> 16
ja_fica: xD maybe im wrong
ja_fica: never tried it
ja_fica: you are rigths, im such a noob
ja_fica: *right
Wontonimo: i really like the random number use that you pointed out. i only learnt that trick recently
Wontonimo: it makes total sense
ja_fica: modulus cant be avoided
ja_fica: it can but will be less efficient
TobiasA: Hi wontonimo
Wontonimo: :wave: hey hey
BlaiseEbuth: :scream:
Wontonimo: sorry TobiasA if I made it sound like modulus is really really bad. It isn't crazy
TobiasA: got it
_h0ye: im so baddddd
BlaiseEbuth: Stop drug.
_h0ye: :cry:
Wontonimo: I feel like my bitboard game has gotten way better since finishing 3 multis that use it
_h0ye: can any one teach me
martinpapa69: how much you pay
_h0ye: 0
martinpapa69: :sleeping:
Wontonimo: what's your experience level _h0ye
Wontonimo: what do you know?
_h0ye: i dont have any experience
_h0ye: how can i have it
_h0ye: and how can i teach it
Wontonimo: youtube is probably your best starting point. Search "The Coding Train", he has some really good intro videos
_h0ye: ok thx
TimothyAlexisVass: h0ye: freecodecamp.com javascript course
_h0ye: i want python
_h0ye: can i teach it
martinpapa69: hmm my c4 win detector was complete :poop:
jacek: oO
TimothyAlexisVass: google python course
TimothyAlexisVass: https://developers.google.com/edu/python/
TimothyAlexisVass: https://www.freecodecamp.org/news/best-python-tutorial/
Wontonimo: once you know a little python, someone shared this link which i think is great for practice https://www.hackinscience.org/exercises/
Kepe55: I watched a "learn python in 15 minutes" video and just gona over to solving problems lol
Kepe55: I know lua though, so it's easier for me because I know what to search
Kepe55: That's probably why I don't know about many in-built functions etc. though
TimothyAlexisVass: i=input print((int(i())*('O'*int(i())+'\n'))[:-1])
Ran_42: how can i read two ints seprated by space in the stub generator?
AllYourTrees: a, b = map(int, input.split())
Ran_42: read a,b:map(int,input.split()) doesn't work
AllYourTrees: are you using python or something else?
Ran_42: stub generator, im creating a clash of code
AllYourTrees: ohhh
AllYourTrees: nvm ignore what i said then
Ran_42: ok :)
BlaiseEbuth: rtfm
Ran_42: I dont see it on the help section
Ran_42: I need to read x, y and they sepreted by space
BlaiseEbuth: https://www.codingame.com/playgrounds/40701/help-center/stub-generator
Ran_42: ty they should add this info in the little help button, there is a lot missing there
BlaiseEbuth: The exact same text is present in the help button...
Ran_42: I dont see it but ok
TimothyAlexisVass: Ranked 555
TimothyAlexisVass: Is score based on placement in clashes or something else?
BlaiseEbuth: https://imgur.com/OFle3Sl
kingdomplum: hi
kingdomplum: i'm masongtxr
kingdomplum: in a new acount
TimothyAlexisVass: How is the score calculated in Clashes? I was ranked 1, 1, 7, 2, 2 and my score decreased
TimothyAlexisVass: :D
Alfredb: It depends on the opponents ratings. It uses the ELO rating system.
Alfredb: if you only beat noobs, you gain little
eulerscheZahl: ELO only works for 2 player games TrueSkill is used here
BlaiseEbuth: TrueSkill for clashs of code... Ironic isn't it? :smirk:
Kepe55: Does anyone know what I'm doing wrong, I'm trying to solve the Chuck Norris problem
Kepe55: The first test case, Character C works perfectly
Kepe55: but then at CC it fails
BlaiseEbuth: What language?
Kepe55: http://chat.codingame.com/pastebin/7ff5a7a6-0622-49b2-ae5a-47cd39ce6e6f
BlaiseEbuth: Thar's what you're doing wrong.
Kepe55: Found: 0 00 00 0 0 0 00 00 0 00 00 0 0 0000 Expected: 0 0 00 0000 0 000 00 0000 0 00
BlaiseEbuth: *that
BlaiseEbuth: :3
Kepe55: So does anyone know what the problem is in my solution?
BlaiseEbuth: Maxim251 know.
BlaiseEbuth: But you don't listen to him... :(
Kepe55: Wdym with there is 7 bits
BlaiseEbuth: rtfm was also a valid answer though...
BlaiseEbuth: "The input message consists of ASCII characters (7-bit)"
Kepe55: If you print it out though it is a normal string holding a message, not ascii
BlaiseEbuth: :rofl:
BlaiseEbuth: Sorry.
BlaiseEbuth: Do you know what ASCII is?
BlaiseEbuth: (Please don't tell drawing with chars)
Kepe55: Seems like I don't I thought ASCII is the numerical representation of a number, bytes("h", "ascii")[0] would print out 104 for example
BlaiseEbuth: of a char*
Kepe55: What they provide isn't a number tho
BlaiseEbuth: In fact it is, since the string is composed of chars, that are stored as numbers. -> Their ASCII representation
Kepe55: Oh, so it's basically saying that the characters in the message are convertable to ascii
Kepe55: That's what I did though in my code
Kepe55: http://chat.codingame.com/pastebin/53256509-f098-499f-832e-c090732dcedc
BlaiseEbuth: Right. But the number you get is encoded on 8 bits.
BlaiseEbuth: And the puzzle use 7 bits numbers.
TimothyAlexisVass: OK Some of the clashes weren't finished, now it registered.
BlaiseEbuth: So that probably cause problems when you count 0 and 1
TimothyAlexisVass: Wish you all a great day/evening/night!
Giovanick03: I'm 12 going to secondary school
Kepe55: How can I change it to 7 bits?
Kepe55: http://chat.codingame.com/pastebin/53256509-f098-499f-832e-c090732dcedc
Kepe55: Im doing the Chuck Norris problem rn
Naknik: im asking for the question
Naknik: not messing with that again sorry
Kepe55: It works with single letters but not for multiple ones
Kepe55: like its working for C but not for CC
arfelious: hi
Wontonimo: hi new people
Wontonimo: :wave:
michaellan: bonk
Wontonimo: Kepe55, are you still looking for help with chuck norris?
Kepe55: I don't get what's wrong
Kepe55: why it works for single letter strings but not for multiletter ones
Kepe55: Blaise said something about 8 and 7 bit ascii, but i dont get how I should turn 8 bit ascii into 7 bit
Wontonimo: i'm looking at your code
Wontonimo: i'd have one function that converts a 7bit number to binary text, so 3 becomes 0000111
Wontonimo: one way of doing that would be : f"{number:#09b}"[2:]
Wontonimo: i'm substituting that in for your getBinaryFromNumber function
Kepe55: wdym? Doesn't my getBinaryFromNumber function do that?
Wontonimo: no
Wontonimo: your function returns 11
Wontonimo: as a number, not a string
Wontonimo: it needs the leading zeros
Kepe55: and by converting it to an int those zeros get lost?
Kepe55: So if I stop turning it into an int it would work?
Wontonimo: yeah
Wontonimo: you have a function getNumberFromString which i think your intention is to concat all the numbers
Wontonimo: but i'd recommend concat'ing all the binary strings like '0000111' and then the next one etc
Wontonimo: getNumberFromString simply becomes
Wontonimo: return "".join( [ getBinaryFromNumber( ord( c ) ) for c in string ] )
Wontonimo: getBinaryFromNumber(ord('h')) --> '1101000' getBinaryFromNumber(ord('i')) --> '1101001'
Wontonimo: getNumberFromString("hi") --> '11010001101001'
Wontonimo: and the end of your program is simply gotBinary = getNumberFromString(message) print(encode(gotBinary))
Kepe55: Wait so I would turn my getNumberFromString into def getNumberFromString(string):
return "".join( [ getBinaryFromNumber( ord( c ) ) for c in string ] )
Wontonimo: http://chat.codingame.com/pastebin/4e69cac3-f4be-4186-9175-d752bf9573ac
Wontonimo: yeah, that's right
Kepe55: ValueError: Unknown format code 'b' for object of type 'str' at Answer.py. in getBinaryFromNumber on line 10 at Answer.py. in <module> on line 32
Kepe55: http://chat.codingame.com/pastebin/7a1c81f7-bc5f-417d-94ed-fa01a8ad0b2c
Kepe55: am I missing something?
Wontonimo: This is the problem : "{0:b}".format(number) use this : f"{number:#09b}"[2:]
Wontonimo: add assert( getBinaryFromNumber(3) == "0000011" )
Wontonimo: to your code right after getBinaryFromNumber
Wontonimo: to make sure it is calculating correctly
Kepe55: http://chat.codingame.com/pastebin/9bdc0f21-ce80-4512-b5dc-62b3569f429d
Kepe55: ValueError: Unknown format code 'b' for object of type 'str' at Answer.py. in getBinaryFromNumber on line 10 at Answer.py. in <module> on line 34
Wontonimo: I made some other comments above : about "and the end of your program is simply"
Kepe55: http://chat.codingame.com/pastebin/cbe7e7bd-43a6-455b-89b6-3163615ca08e
Wontonimo: :tada:
Wontonimo: no prob
Wontonimo: i'd like to suggest adding little micro tests for each function, like the assert I shared
Wontonimo: it really helps with debugging and ensuring your code continues to work after refactoring
Wontonimo: for ultimate tic tac toe I have 1000 lines of code, 400 of which are asserts and similar tests. So about 40% of the code just tests the code.
martinpapa69: writing tests :sleeping:
Wontonimo: lol
Wontonimo: :worm:
Wontonimo: :bug:
Wontonimo: :
Kepe55: how do I even print on Ultimate Tic-Tac-Toe for debugging without it taking the message as input for the game
Wontonimo: use stderr instead of stdout
Wontonimo: if you want to know how to do that in your language, it is in the default code comments
Kepe55: Oh, I deleted that comment, its print("Debug messages...", file=sys.stderr, flush=True)
ja_fica: im buffing allyourtrees so much in C4 with my experiments
ja_fica: *AllYourTrees
Kepe55: damn I dont understand why it picks an invalid action even tho it gets it from valid actions
Kepe55: http://chat.codingame.com/pastebin/1adaaed3-a713-43a6-9900-b8146492674e
eulerscheZahl: only do 1 print per while-loop iteration
eulerscheZahl: otherwise you get out of sync with the actual game
michaellan: I recently golfed Chuck Norris
michaellan: not amazing but it'll have to do
michaellan: *in Python
Westicles: I don't know how that guy did in in 72
BlaiseEbuth: Baguette compression.
Kepe55: eulerscheZahl when I try to break out of the range loop it errors: ValueError: invalid literal for int() with base 10: '2 1'
Kepe55: http://chat.codingame.com/pastebin/21f0a0bf-f67d-49de-a4db-1c8030f2433b
Westicles: Space Shooter, another mcts bitboard?
eulerscheZahl: oh, it got approved
eulerscheZahl: congrats on being 1st on the leaderboard Westicles
Westicles: thanks! just a simple nn
Naknik: hey I made a CoC problem but I need someone to help me set up the contribution anyone?
jacek: :thinking:
jacek: oh, i forgot! happy Caturday
Manasmishra: it's saturday not caturday
xpman: lo
Maxim251: Thats we can make special day Caturday :D
Maxim251: Omy god, I use first time iterator in codingame :D I never used before, i dont have reason to do that, even, I try not use it. But In that situation what I have now, I see that is easier delete position in array in this same loop.
Maxim251: I hope if in for loop if I delete position in vector, still for loop will iterate to next position as usual
Maxim251: and... Bad idea, Iterator works, but my logic is bad... oh.
jacek: umm dont delete using iterators
jacek: at least, try to do it smartly
Maxim251: problem is that Robot need remember turn in new direction, but when he again go to that place, then is destroyed... Problem is that I know how mapped that place, but I dont know how delete robot when he get to that place.
Maxim251: Happly deleting position using iterator works beatifully, but my logic is bad..
Maxim251: http://chat.codingame.com/pastebin/7b3368b6-f344-40ae-bdf9-a3a625714cf5
Maxim251: this is sample of that function
Maxim251: shortly that means, if robot go to position on map that is not avaible to move, then delete robot
Maxim251: Oh my, I had bug, now I know why code did not work. Thats bug is from that stupid ones
Maxim251: No, still problem. But at least I ged read of stupid bug :)
jacek: oO
AllYourTrees: holy crap
DJSunnyNoodleOfPower_912f: has anyone received career opportunity through codinGame received an invitation for coding test from codingame. was wondering if it is worth giving it
DJSunnyNoodleOfPower_912f: Do companies use CodinGame to scout for potential candidates?
therealbeef: sure, it's a big part of the business model of codingame I guess. and some companies use it in interviews
Maxim251: I try it, 0 resonse.
therealbeef: win a company-sponsored contest and I bet they contact you ;-)
DJSunnyNoodleOfPower_912f: Thanks, guys. I will try the test and check out the contests too.
Maxim251: I did win, and also 0 response
ArtLiteracyStory: Hello world
ArtLiteracyStory: anyone know a good Twitch stream playing this game?
MSmits: Astrobytes finished oware endgame book article, not everything explained as well as I wanted, but one part is really mathematical. The code works though, only need to adjust the sim.
EDRISS: hi, i know the basics of coding but I didn't practice much so I feel that i need hints to solve the puzzle cuz i dont even know how to start i need some solved examples to get going. Python please
Naknik: do clash of code before puzzles
69razer69: why c in called c i mean there is f and d also is there a reason why they r called like that ?
ProCoder03: well, its predecessor was called 'B'
ProCoder03: so successor is 'C'.