Chat:World/2021-02-12

From CG community
Jump to navigation Jump to search

jcode94: lmaoo

Default avatar.png Tuanas: lmao

Default avatar.png Tuanas: lick my ass onii chan

Default avatar.png trashcan06: yikes @Tunas

Default avatar.png trashcan06: * @Tuanas

Default avatar.png Saad-py: HI

Default avatar.png Saad-py: hi

Default avatar.png Saad-py: How do I get the nearest value to 0 in python, i am very confused about abs

Default avatar.png suuuumcaa: I'm looking for a mentor for work, my telegram @suuuumcaa

Divlo: Hello world!

Default avatar.png TWrecks: Hey guys

Default avatar.png TWrecks: If you fail a Clash of Code

Default avatar.png TWrecks: Can you do it in your own time or whatever?

Default avatar.png TWrecks: I find myself continuously frustrated that I can't get it done in the timelimit... Even simple problems.

KiwiTae: u can solve any problem on your own

Default avatar.png TWrecks: How?

Default avatar.png FryMeALiver: screenshot it and solve it later perhaps

Default avatar.png TWrecks: Ahk

KiwiTae: u can also ask others to share their solutions so u can see what went wro,ng

Default avatar.png TWrecks: Nobody is coding in FSharp

Default avatar.png TWrecks: So I can't read their answers

Vigasaurus: Also after you're done you can try to look it up here to see the problem and test cases again https://eulerschezahl.herokuapp.com/codingame/puzzles/

Vigasaurus: And do it at your own pace

Default avatar.png TWrecks: Ah thanks that's great

sayankhanmidnapore: https://www.codingame.com/clashofcode/clash/15899243e21f9ddd6ed15a3c8d62adc645050cd

Default avatar.png Sepehr.khashei: :|:

lopidav: eulerscheZahl you have a base with all puzzles? Can I use it in my tampermonkey script?

Audatic: there should be an achievement if you complete a clash 100% in under 30 seconds :D

Totomns: yes and the achievement will be "do not read the instruction"

Audatic: easier to look at the sample in/out :D

Default avatar.png FryMeALiver: any idea why when i make a contribution to clash only one example shows even though I have multiple?

lopidav: reading the statement to the end is an advanced coc strat. It took me two years to learn it and I still can't pull it of consistently.

lopidav: FryMeALiver give me a link

Default avatar.png FryMeALiver: https://www.codingame.com/contribute/view/6238cf959ba938462e529d930fe417610a60

lopidav: of, I realized your question. Example is always one. There are multiple test cases tho, and the are there. Example is just a first test included in the statement so players waste less time going to the tests window

Default avatar.png FryMeALiver: even if its a reverse challenge?

Default avatar.png FryMeALiver: then multiple should appear no?

lopidav: multiple will appear

lopidav: FryMeALiver here how it'll look: https://i.imgur.com/GojwrBi.png

Default avatar.png FryMeALiver: nice thanks

Default avatar.png UncleZam: hello! I'm new here and was wondering if it is possible to use Vim bindings in editor?

ChristofferKJ: is clash down?

ChristofferKJ: for everyone

Nativeman: yee

ChristofferKJ: ty

Default avatar.png phantom1299: is there a lag on the servers right now?

Default avatar.png phantom1299: playing clash of code rn and when submitting my code it gets stuck on "Pending results..."

Nativeman: others can't even get into a game

Default avatar.png phantom1299: oh, so its not just me

jacek: oO

Default avatar.png Shurishe: I told everyone do not deploy anything on Friday. Never touch servers in friday:joy:

Magus: I pinged the staff about the CoC issue on discord. There is nothing more to do for the moment.

jacek: nothing more no CG. theres only clash on CG. no multiplayer bots, no optimization, no codegolfs... only clashes

jacek: AutomatonNN do something

AutomatonNN: eulerscheZahl is there a way to do that in the contest i want to learn c++ i guess

Andriamanitra: :worried:

Magus: Oh, so this is true

Magus: NN does ping euler :D

Magus: Automaton2000, do you ping euler too?

Automaton2000: its not that much of a difference

MadKnight: oh magus in #world

MadKnight: so rare

Nativeman: did they fix yet?

Magus: Yes it should be fixed

Default avatar.png NOTsteve: any recommendations for an easy bot programming game to try after Coders Strike Back? I got to bronze league in that and wanted to try something different but alot of it still seems over my head

jacek: try silver in coders strike back

Default avatar.png NOTsteve: I kind of wanted to try a different game before continuing with CSB

Default avatar.png TH3Mjuss: Hello, I am having an issue with episode 1 of Power of Thor, could anyone help me pls ?

darkhorse64: Game of Drones is quite to start with

darkhorse64: quite easy

Default avatar.png NOTsteve: thanks @darkhorse64

jacek: :notebook: :soccer:

Audatic: why is there no win statistic? :)

jacek: where

Audatic: for clash of code, would be more fun if you actually get a counter how often you won

jacek: oh

Rocky[K.G.F.]: hii

Andriamanitra: @Audatic i just look at the number of clashes played because i never lose :)

KiwiTae: TH3Mjuss read the hints

MSmits: Audatic the win statistic would not be very meaningful as the number of wins depends a lot on the strength of your opponents

MSmits: instead watch your leaderboard ranking

MSmits: for example, someone who takes care not to battle stronger players, will have more wins, but will not get a better leaderboard rank

Rocky[K.G.F.]: nice Andriamanitra

Audatic: We should play a round, I also never lose ;)

jacek: a force that cannot be stopped meets an object that cannot be moved

jacek: what happens then

jacek: :head_bandage:

Uljahn: NotImplementedError

Audatic: https://www.youtube.com/watch?v=9eKc5kgPVrA

Rocky[K.G.F.]: yeah it is true

Audatic: MSmits I feel the leaderboard is more about who plays most often not the win rate. I don't mind that it isn't perfect, it's just for fun. But given that there is no "history" of games played it feels less relevant if I win or not

Audatic: and there could be a "serious" mode where the opponents are always random, it's always 8 players and the language is restricted

Wontonimo: if it is a 'trueskill' score, then you are also measured on how consistently you win/lose against what the other players rank is

Wontonimo: just being consistent will raise your rank. So, if you play a lot without getting better, but you are consistantly playing at your level, then yes, you will see your score increase marginally

Wontonimo: https://en.wikipedia.org/wiki/TrueSkill

Wontonimo: one way to think. of it is that you have a penalty of 3 times your inconsistency.

Andriamanitra: it seems there's also quite heavy penalty for inactivity

Andriamanitra: i've seen top20 players drop down hundreds of spots in just few weeks of not playing

Wontonimo: yeah, there is that. incentive to stay active

Audatic: okay I see, didn't realized that it's using the Trueskill algo. I think it would still be fun to have a record of games you played/number of wins. Just for the fun of it. But I get your point :)

Wontonimo: personally, i'd recommend not getting to focused on your CoC score. CoC is a great place to practice your skills in a new language and watch yourself go from not being able to finish in time to ranking well. Those pesky python coders are gonna always give you a run for your money, so instead focus on how well you did vs you. I see some of the live streamers doing that, challenging themselves to compete with new languages. top notch there

Wontonimo: wow @Andriamanitra - 14th in CoC! that's crazy high. Congrats!

Default avatar.png phantom1299: ruby programmers beat everyone in shortest mode

MadKnight: true

MadKnight: but what's your point ?

Nativeman: x,y

MadKnight: that's a vector

Default avatar.png 18o3: hello

Mingus: hello

Default avatar.png georgiouilias: hello.

JohnathanBarbee: hello

Wontonimo: s/.*(hello|hi).*/\\1 to you/i

Alshock: that doesn't work Wontonimo

Alshock: "wow @... - 14th in CoC! that's crazy high. Congrats! to you

Alshock: "

Wontonimo: how does that not work?

Wontonimo: u nO liKy My eNglisH?

Default avatar.png Guzmicz: Good day :-)

Default avatar.png trashcan06: :upside_down:

Default avatar.png Okachobe: Is this chat specifically for the problem im doing or is it a general chat?

Default avatar.png ichwarsnix: general chat

Default avatar.png Okachobe: ahh thank you

Default avatar.png ichwarsnix: but if you have a question you can still ask

Default avatar.png Okachobe: Sounds good I appreciate it. this seems like a good website to practice new languages without having to come up with my own coding projects and setup so far

jacek: :+1:

Default avatar.png Saad-py: hi

ElGoblino: guys what the hell is ASCII art

Gorgony: Im encoutering a problem with code vs zombies: https://www.codingame.com/replay/528339342. A zombie gets killed twice, and the second time it says my code didnt output a input in time, but the problem is not in my code. Anyone knows (what seems to be) this bug?

struct: weird bug

MadKnight: > but the problem is not in my code but are u sure ?

Gorgony: Yeah

Gorgony: I was just starting out

struct: this seems like a referee bug

MadKnight: it could be just a thing that happens when u don't print anything

struct: it even shows that he killed the zombie twice on the replay output

MadKnight: it just shows the same exact frame from the last turn

Default avatar.png mustafaozx: hello there

Default avatar.png hackrman: general kenobi

MadKnight: Gorgony it seems that it's just showing the same frame from last turn which could be a thing when u actually don't print anything

MadKnight: check your code again Gorgony

Gorgony: I will check again

Gorgony: I didnt know that the last frame was shown when you dont give an input

MadKnight: it's just the way they made replay viewer

MadKnight: it had to show something

Gorgony: But it seems my code was waiting on a readline while it shouldnt

MadKnight: maybe

Gorgony: Thats why console.error also was not in the console

Gorgony: Because it was after the readline

Gorgony: Thank you guys

struct: https://www.codingame.com/replay/528344098


struct: https://www.codingame.com/replay/528344368

struct: There is no bug I guess

Gorgony: I already thought it was strange that there would be a bug like this in a game that is several years old

Gorgony: I should have known it was my code

Default avatar.png Okachobe: Is there any way to post the code to the problem were doing? instead of just the replay. I keep running into a problem which says that my program didnt write to the standard output in time. My code looks almost exactly the same as the solution code and I had this problem earlier too.

struct: just paste it here

MadKnight: (he fixed it)

jrke: is CG pastebin workin'

MadKnight: it's RNG-based

MadKnight: test it

MadKnight: http://chat.codingame.com/pastebin/f41f3bc2-5867-4d96-993c-c61ebe925570

MadKnight: yep

jrke: testing number - 1

jrke: http://chat.codingame.com/pastebin/c52e0755-eb68-4576-b0f8-82ad743c10b0

MadKnight: nice code

jrke: test succeded congrats you reached level 2

jrke: lol

MadKnight:

   int img[x * y][3];

MadKnight: u can't do that in visual studio c++

MadKnight: x y are not const

jrke: thats code for gaussian blur image

jrke: oh edited that in code blocks a bit

[Kian-carling]: hi

JLukeSkywalker: darn, need top 2% bots to get the achievement thing. just got stuck at 3%

JLukeSkywalker: almost there

jacek: top 2% where

JLukeSkywalker: multiplayer bots

jacek: aww

JLukeSkywalker: for the homepage quest

Alshock: -3vel

jacek: that should be top 5%

JLukeSkywalker: i think if I get to gold in a second game i will hit it

JLukeSkywalker: and the previous quest is hit gold in a single league

JLukeSkywalker: so 2% might not be unreasonable

Wontonimo: thanks, I was wondering what I'd have to reach next on the quest line after gold. 2% it is

Wontonimo: we both need in the range of 2,500 more points (less for you, more for me) to hit 2%

JLukeSkywalker: climbing code royale rn, should just under 1k the next calculation

Default avatar.png V-def: helo

jacek: good evening

MSmits: hi jacek

YurkovAS: MSmits in mcts after expand node to children you play random playout games for each unsolved children or only for one child? This give many rollouts, but play worst for me.

MSmits: i tried both, same result as you

MSmits: darkhorse had a slightly better result with rolling out from each child

MSmits: but I never did

jacek: you have many rollouts, but shallower tree

darkhorse64: Yeah, I always do that. It also simplifies the implementation

MSmits: for some other games it was better for me

MSmits: especially games with less branching

darkhorse64: When expanding, I allocate a contiguous memory space for children which is completely used. So, it saves space

MSmits: it's just one of those things that you try for uttt and works differently depending on the rest of your bot

darkhorse64: Of course, it means you have to tweak the exploration parameter

darkhorse64: I did that first for uttt. It was a net gain for me

MSmits: i dont think it's just that, there's tons of little things about a bot that may change the effectiveness

MSmits: for example, if your rollout is heavier, it might be better to only do 1 each time

darkhorse64: ept is the other side of the spectrum. Light rollouts but many of them

MSmits: yeah

darkhorse64: I am amazed you are still finding new ideas for UTTT. How many versions (not variations) did you wrote ?

MSmits: full versions 3

MSmits: i mean 3 completely different bots

jacek: uttt is neverending story

MSmits: one is EPT, one is a bot with binary representation and heavy pruning, few lookups. One is a ternary representation with less pruning and light rollouts

Default avatar.png Angecide: when going for the one rollout per iteration, do you pick a random unvisited child, or just the first child in the list of children that is unvisited? it feels like picking a random child would give better distribution but also more expensive search

MSmits: (with heavy lookups)

MSmits: the EPT bot sucked

MSmits: Angecide never saw much difference, so i just pick the first

Default avatar.png Angecide: I see

MSmits: but yeah theoretically random should be better

MSmits: uttt doesn't always obey the law of making sense

jacek: oO

darkhorse64: I have two different engines (binary and ternary) but it did not make any difference.

MSmits: which is pretty weird

MSmits: because working with ternary is very different, it should be much slower or faster...

MSmits: but this is my experience a swell

darkhorse64: Any difference in ranking

MSmits: no idea

darkhorse64: I mean ternary and binary engines did not result in any different in ranking for me. I came to the conclusion that it was a kind of dead end for me and I should try other multis

MSmits: ahh

MSmits: well I still have many ideas to try for uttt, maybe I'll write them up when I am finally done with it

MSmits: the game has a lot more depth than I first thought

MSmits: wish i was able to write a good eval for this though, would like to have a competing EPT bot.

darkhorse64: One thing I have not tried (learned from other bots) is implementing the game state with m128.

MSmits: I did that, but it's only helpful if you save same time with AVX somewhere

MSmits: some time

MSmits: got some small improvements from it, nothing shocking

darkhorse64: I see I could implement a very fast move generator with that representation. I did something similar with C4. The only issue is randomizing a move choice without pdep/pext

MSmits: thats true

MSmits: I have a move generator like that

darkhorse64: It takes way too much time to find/select a move with my current engine.

MSmits: it's nice for initially getting all the moves

MSmits: but you still need to check whether the board is actually finished

darkhorse64: extract 9 bits / lookup

MSmits: i dont really use extract. I just union the thing with a normal array

MSmits: easier

darkhorse64: extracting is needed if the whole game state is a bitboard. My current engine is 10 separate boards. Easy for lookups but bad for move generation. Anyway speed is not that important. I did an experiment: disable optimisation which divides the rollout count by 3 for me. The bot still ranks between 30 and 40. Conclusion; you really need massive speed improvements to gain something. Being smarter pays more

MSmits: thats true. I did a test once with half calculation time and the winrate was 40% vs my full calc bot

karliso: "implementing the game state with m128" Why would you do that? I don't see a single reason how SIMD would help.

MSmits: http://chat.codingame.com/pastebin/64573132-7abb-4ed6-852a-e0da327cbc3c

MSmits: right before sim, i can pull out an array of moves this way. Then when the sim starts, i adjust them every time i do a move

MSmits: saves a little time

MSmits: might be negligible

MSmits: but you're right karliso, during sim it's quite hard to use simd for anything

karliso: This is only useful when you are given free move and can choose from all boards?

MSmits: sure yeah, it can be used for that

MSmits: i dont do that though

MSmits: I mostly use popcounts and pdep and such

darkhorse64: m128: the idea is to have the game state in one place and perform everything with masks, popcount and friends

MSmits: i would say m256 though

Default avatar.png Nandita: Has anyone solved the defibrillators challenge?

darkhorse64: The usual joke is to give you the number of people who did: several thousands

struct: Since I saw puyo puyo engine on AVX, I believe anything can be made

MSmits: sure, i think it can be, but it's not always useful

MSmits: how would you parallelize jumping from board to board

MSmits: karliso is right that you can only really make good use of it on a free move

struct: darkhorse64

struct: check _mm_mask_expand_epi32

struct: _mm_mask_compress_epi32

MSmits: that first one requires avx 512

darkhorse64: You are probably right. Optimizing something that happens less than 10% will not be rewarding. RTFM now :grinning:

struct: ah

struct: Yeah sorry

struct: did not notice it was avx512

struct: my bad

struct: they are both for avx 512 :(

MSmits: some day...

darkhorse64: Good to know anyway

ZarthaxX: i used the compress one, love it

Default avatar.png Angecide: MSmits I read yesterday that ur uttt bot had around 2k lines of code which got me speculating on how that happens, is it because there are multiple rollout and mcts algos depending on which side you play on and which stage in the game you are on (early/mid game) ?

MSmits: for that bot, yeah, that's part of it, though I did not go as far with that as some, probably

MSmits: it's mostly that i made them really heavy, both expansion and rollout

MSmits: but this is not my live bot. My live bot is quite tiny

MSmits: less than 1k if i take out the opening book stuff (it is not being used anyway)

Default avatar.png Angecide: I see, I should probably look into trying some of that as well, the discussion about pure performance on normal mcts having negligible effect compared to sacrificing performance for doing smart rollouts and move selection made me think a lot, but it is quite a challenge to find the right combination of things to get some improvements

Default avatar.png Angecide: improvements as in getting the bot to perform/play better

MSmits: yeah it is. Mind you, performance is still important, especially when it's your only edge. But when you start getting creative you can get bigger improvements

Wontonimo: if alphaGo taught us anything, it's that mcts+heuristics=win

MSmits: heuristics?

jacek: nn

jacek: guided mcts

MSmits: when someone says heuristics i kinda think of if/else

MSmits: not a nn

Wontonimo: doesnt' have to be nn, could be hard coded smarts

MSmits: i did that in plenty of bots

Wontonimo: like if/else , board weights

darkhorse64: i'd say smart eval, whatever it is

MSmits: also pruning moves

Wontonimo: yeah ,smart eval is a heuristic

jacek: pruneArray?

MSmits: let me give a typical prune for uttt

MSmits: say you have 2 ways to win

MSmits: one gives the opponent a free move

MSmits: one doesnt

MSmits: in that case, dont include the free move win in your list of children, just ignore it

MSmits: never explore it

Default avatar.png Angecide: when you say "win" do you mean winning a small board right?

MSmits: yes sorry

MSmits: another thing is when there are 2 ways to win

MSmits: and bot give a free move

MSmits: both

MSmits: then only include 1 of them in your list of children

MSmits: prune the other

MSmits: there are more of those things

Default avatar.png Angecide: ye pruning sounds cool, until the enemy plays a move that you pruned, then it becomes a bit of a pain to add that node back into the tree

MSmits: and since expansion is usually not much of a bottleneck, why not make use of them

MSmits: just reset your whole tree

Default avatar.png Angecide: oh

Wontonimo: it feels true. long ago I wrote two checkers bots, one that eval'd on piece count, and the other eval'd on freemove count. Playing the freemove count bot felt like it was choking you all the time ... where as the piece count bot seemed dumb

MSmits: tree reuse is overrated

MSmits: if you prune 1 move, you will have more depth in the others

MSmits: so it's a gamble

Default avatar.png Angecide: I see, I guess working under the assumption that the enemy will play smart as well seems like a good gamble in high legend

MSmits: most likely any prune you do is never going to affect the game this way because most expansions happen in parts of the tree that are never going to be encountered in the game

MSmits: there are only 81 moves played

MSmits: and millions of nodes expanded

MSmits: so, why worry :)

Default avatar.png Angecide: yea that's true

Damderiam: I'm sure this is a really obvious question, but why is "for i in v:" iterating backwards and skipping index 0 in python where v is a list of integers?

MSmits: because i are not indices

MSmits: they are the actual values in the list

MSmits: v is not sorted i guess

jacek: v = [4,3,2,1,0]?

Damderiam: Not sorted, no

MSmits: it's just iterating over the list in the order in which it is stored

MSmits: starting with the first element

Damderiam: I'm doing the stock exchange losses, and I'm doing it fine in C++ but I clearly don't understand python syntax

jacek: in C++ it would be for (int i : v) {}

jacek: what is i?

Damderiam: I'm trying to iterate from index 0 to index n, which I thought was what "for i in v" did

Damderiam: i is just an iterator

MSmits: Damderiam can you do print(v) and tell us what it gives you

jacek: for i in range(0,n):

MSmits: a range is basically a list of integers

Damderiam: v is 5 3 4 2 3 1 in this particular puzzle

MSmits: and thats why it doesnt give you 0 and goes backward

MSmits: it starts with 5, then 3, then 4 etc.

MSmits: when you say "for i in v"

MSmits: you're basically saying "for each item i in v"

MSmits: so i can also be an object

MSmits: in your case it's an integer

MSmits: but it could be a list of cars

MSmits: it would just iterate over the list of cars

MSmits: you're confusing the items in the list with the indices of the items in the list

MSmits: v[0] = 5;

Damderiam: So I am doing it right, I was just not understanding the stderr

MSmits: possibly

jacek: "it works. i dont know why"

Damderiam: Well, I know why the C++ version works, I don't know why the python version doesn't

Damderiam: But I guess that's part of learning a new language

MSmits: yeah, i learned python here on CG, by doing all easy puzzles i hadnt solved yet

MSmits: i did 30 of them in a few days

MSmits: (while on vacation and my wife was asleep :P )

Damderiam: It's such an unusual syntax, but I'm sure I'll figure it out

MSmits: it's not that unusual. Depends on what you're used to

MSmits: the tab thing with no brackets takes more getting used to

MSmits: once you get good with python you can do wonderful things with just a few lines of code

Default avatar.png reactToThisVue: for i,e in enumerate(['a','b','c','d','e','f']): http://chat.codingame.com/pastebin/af434e5f-29a4-4f97-97b7-46804a118d54

jacek: :thinking:

Default avatar.png reactToThisVue: sry I didn't mean to send 2 outputs

Default avatar.png reactToThisVue: 2 try

Default avatar.png reactToThisVue: for i,e in enumerate(['a','b','c','d','e','f']): http://chat.codingame.com/pastebin/f192ed3c-811c-4f1b-aa35-782d4322d7b2

Default avatar.png reactToThisVue: ok, now

Default avatar.png reactToThisVue: so basically it's like MSmits said. Don't get confused with the diference between index (indices) and element (elements) while in the example above i stands for the index and e for the element. You can use them both with enumerate(iterable) in pyhon

Default avatar.png reactToThisVue: http://chat.codingame.com/pastebin/251451da-898d-4646-8d1b-a874f8775737

Damderiam: Yeah, I got it working by using enumerate to keep track of the index being worked on for each loop

Default avatar.png reactToThisVue: perfect

Default avatar.png reactToThisVue: otherwise you can reverse the list with list.reverse() or list=list[::-1]

Default avatar.png reactToThisVue: than i and e would match

Default avatar.png reactToThisVue: also reasonably is the following syntax: http://chat.codingame.com/pastebin/2dfd88d7-a0a4-4660-8827-11352254ba70

Damderiam: I really had to get C++ syntax out of my head was the problem

Damderiam: I've only barely used python, and not for years, so I was doing everything totally wrong

Default avatar.png reactToThisVue: yeah that's true I've written a lot stuff in c++ and if I would write c++ now I had to google every 2 seconds

Majeck: .

Majeck: thought the chat was lagging

Andriamanitra: i always forget not to play clash at this time of day

Andriamanitra: i don't understand why they can't have this silly lagfest during the time when no one is playing (about 5 hours from now)

therealbeef: by then Asia is playing

Andriamanitra: from my experience at least clash is pretty dead at that time of day, cant even get games with more than 2-3 human players

Default avatar.png Kevinboards: it is friday though

RockNTroll: Just need a banner across the side that makes it an exciting event rather than what it actually is which is a lagfest