Chat:World/2021-06-20

From CG community
Revision as of 05:29, 21 June 2021 by Chat Log (talk | contribs) (Created page with "File:Default_avatar.png Kokoz: what is codeforces? <img src=/a/66377609367581> Davide666: what is programming? File:Default_avatar.png Kokoz: I am still trying to fi...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Default avatar.png Kokoz: what is codeforces?

Davide666: what is programming?

Default avatar.png Kokoz: I am still trying to figure that out

ableflyer: what is computer

Om1234: tumlog sab makkar ho

Om1234: makkar

Om1234: aaaaaaaaaaaaaaaaa

Davide666: What is Mouse?

Default avatar.png TORIBON: What is System.Text?

Davide666: what is try again?

Davide666: fucking error!

Davide666: I LOVE Error (^^)

Default avatar.png TORIBON: What is Love?

Davide666: :nerd:

Default avatar.png Oklabeer: is C great ?

jacek: then C++ is greater

Default avatar.png borrel: @TORIBON the fire of hell and haven combined

MiyamuraIzumi: What is C?

MiyamuraIzumi: a character?

Default avatar.png TORIBON: It's a part of dees

MiyamuraIzumi: which multi is fun to practis on mcts?

jacek: uttt?

MiyamuraIzumi: is it complicate to practis mcts?

MiyamuraIzumi: I want a simple one

MSmits: connect 4 is maybe better these days, because you can tell your bot is making good moves or not

MiyamuraIzumi: I am still quite new

MSmits: it is complicated if you have never done mcts before

MSmits: it's kind of a hurdle, to get your first mcts working, because it has several parts

MiyamuraIzumi: yeah I've never done mcts

MSmits: best to google some examples

MiyamuraIzumi: on CG which game is for newbie on mcts like me?

MSmits: I'll find some examples, sec

MiyamuraIzumi: thanks

MSmits: https://www.codingame.com/multiplayer/bot-programming/tic-tac-toe

MiyamuraIzumi: should be multi

MSmits: https://www.codingame.com/multiplayer/bot-programming/connect-4

MSmits: https://www.codingame.com/multiplayer/bot-programming/bandas

MSmits: bandas simulation could be a bit complicated, not sure

MiyamuraIzumi: which one is for newbie like me?

MSmits: but these are games where plain mcts works well

MSmits: uttt or c4 is easiest i think, but neither will be easy

MiyamuraIzumi: thanks

MiyamuraIzumi: I will choose one of them for start

MSmits: uttt has an easy wood league with 3x3 normal ttt

MSmits: but you quickly get out of that

MSmits: I suggest writing a simulation first and testing it

MSmits: before getting into mcts

MSmits: so, make a move generator that find all possible moves and test what happens in your simulation when you apply a move

MSmits: maybe use debug print to print the move list and print the state after applying a move. That sort of thing

MSmits: you dont want to have simulation bugs and mcts bugs at the same time

MiyamuraIzumi: thanks

MSmits: nnp

MSmits: -n

MiyamuraIzumi: ?

MSmits: no problem

MSmits: with one too many n's

MiyamuraIzumi: ah

artymis: hii

Default avatar.png Rip86: hi

darkhorse64: just for fun, I tried a Monte Carlo bot for C4 -> #60. Maybe not strong enough for a boss

struct: maybe the current bot with 2ms

struct: could be top 20

struct: :p

struct: But I would not want to share this bot code

struct: So theres that downside

darkhorse64: Same so it must be a different code base. There's euler's C# sample code to adapt.

darkhorse64: euler is #46.

MSmits: btw. Got another level for my oware endgames

MSmits: End games done. Time: 4414 minutes. Seeds: 34

MSmits: 2 more before I stop

darkhorse64: There is now Marchete CGZero to play with

MSmits: he shared his oware thingy?

jacek: CGZero?

darkhorse64: sec

jacek: https://github.com/marchete/CGZero

jacek: oh my

darkhorse64: https://www.codingame.com/forum/t/alphazero-like-implementation-for-oware-abapa-game/191477

MSmits: it's untrained i think

MSmits: and has no nn structure

darkhorse64: An exercise left for the readers

MSmits: thats good, prevents copy pasting

MSmits: I'm gonna use the inferrer for sure

MSmits: but i already could with mokka

struct: already training

MSmits: lol struct

MSmits: I think I may write some tech.io stuff while on vacation.

MSmits: after school is done

MSmits: uttt guide for sure

MSmits: what else is interesting?

struct: I could share the c4 thing but I feel like its a bit too much

struct: Maybe just the scalar version of it would be fine

MSmits: hmm

darkhorse64: writing a new boardgame multi ?

MSmits: yeah it's difficult, the game is so simple that if you share something, you nearly share all :)

MSmits: me darkhorse64?

MSmits: I've never done that, it's not really my thing

struct: I dont even feel like sharing how I update the move mask, because it gave me a slight boost in performance

MSmits: then don't struct. The stuff that is most worth sharing are things that are generalizable

MSmits: not some little trick used in one boardgames

MSmits: like general bitboard tricks

MSmits: or simd

MSmits: stuff that happens in a lot of games

darkhorse64: No, I have two ideas in mind but I'd like to get Legend to SC2021. My BS is working but it's rather weak

jacek: bullshit?

MSmits: ye his bs is not strong like yours jacek :P

darkhorse64: it is yes :sweat:

MSmits: oh beamsearch, i had to think somehow

MSmits: people use mcts with more succes i think though

MSmits: or some variant of it

MSmits: maybe you should do that

darkhorse64: I saw a post from dimasta. I should read all PMs once again

MSmits: yeah, this game had a lot of different approaches

MSmits: as contests go, it was a good one I think

darkhorse64: I fail miserably during the contest and I still feel far from a successful bot. The sim looks OK

MSmits: i did a sim verifier by predicting all opponent moves and the resulting gamestates

MSmits: thats how i found bugs

MSmits: most common bug is simulating what happens when two seeds go to the same spot

MSmits: did you try pruning some stuff?

MSmits: like a fixed order for improving trees during a turn

MSmits: otherwise branching is too great

jacek: branching in trees eh

darkhorse64: Yes, for seeding mostly, I still have to code complete/grow/seed order

darkhorse64: gotta go

Default avatar.png punter147: hello people, i am stuck in gold leage in uttt. Any suggestion on improving my solution? I am working now on increasing the number of simulations using bitboard technique.

jacek: mcts?

Default avatar.png punter147: jacek yes i am using mcts.

jacek: try: mcts solver, smarter rollouts (avoid losing and make winning moves if possible), fine-tune exploration, add bonus for winning small boards, teccles heuristic opening (make a move that would go back to the current board)

jacek: but if you dont have bitboards now, do it. itll probably give you 10x more simulations

Default avatar.png punter147: oh i see. thanks jacek. i will go ahead with bitboards then...

Default avatar.png punter147: thanks for the tips on smarter rollout, will try it out, what is teccles heuristic opening tho?

jacek: if you can, make move that would end up in the same board

jacek: i.e. you are on left upper corner, then make move 0 0

jacek: i.e. look here for 20+ first frames https://www.codingame.com/share-replay/563163886

Default avatar.png punter147: oh i see. thanks for the clarification jacek. will certainly try this out.

Default avatar.png punter147: i found a website that might help newbies get started in uttt. i dont know how it compares to legend bots here on CG but it is a very strong AI. https://www.theofekfoundation.org/games/UltimateTicTacToe/

Default avatar.png punter147: super useful to test your AI

Default avatar.png punter147: access the setting on the top bar and you can enable AI weights as well. i shows the move that AI thinks is the best given the state of the board.

jacek: nice. though rules on CG are little different

jacek: if no one wins by 3-in-row, then player with most won small boards wins

MSmits: this other game is probably solved as a draw

MSmits: because p2 can succesfully block all 3 in a row attempts

MSmits: but it's much harder to also get an equal number of won boards

jacek: https://minimax.dev/docs/ultimate/

Default avatar.png punter147: jacek you are correct. i found it useful to give a general direction of correctness of my ai tho. Do you have any methods to figure out whether the algorithm is actually intelligent? its a randomized algorithm right, so very difficult to say anything until the end of the game. Or am i missing something?

MSmits: do you mean a way to test your mcts?

MSmits: see if it gets better with more rollouts

MSmits: limit calculation time

MSmits: or write a minimax bot as a benchmark

MSmits: with some sensible evaluation function

MSmits: it's not entirely correct to say that mcts is a randomized algorithm

MSmits: it has a random component to it

MSmits: but the result is not random

MSmits: it converges on the best moves if given enough time

MSmits: for example, an mcts bot will always tell you to start in the middle

MSmits: if you give it maybe a few milliseconds

Default avatar.png punter147: MSmits yes; I see thanks for the advice. Yeah as you said then the AI must get better given more rollouts per turn.

MSmits: right

Default avatar.png punter147: I see this currently with my uttt bot, the AI gets better with more moves(around 60k i saw best performance) squeezing 60k is a huge challenge lol.

MSmits: yes it is

MSmits: wait did you mean 60k moves or 60k full playouts?

MSmits: how do you define a move?

Default avatar.png punter147: a move in my case is select the most promising node, then simulate till completion from that node, and then backpropagate.

Default avatar.png punter147: rn i can squeeze only 200 rounds on CG. i have many issues tho. for example i do not reuse the tree, i create a new tree each turn. and my MMU is very juvenile as well.

MSmits: reusing the tree is not all that important. It helps a little bit, but it's low priority

MSmits: don't know what MMU is

MSmits: Merry Meth User?

Default avatar.png punter147: MMU->memory manager sorry for not explaining, by reading experts posts i realised i need to use pre allocated nodes.

MSmits: ohh ok

MSmits: yeah, but thats pretty easy

MSmits: just make a giant array

MSmits: on a node, you have an index of the position of the first child in that array

MSmits: and a number for how many children

MSmits: then it's easy to loop over the children in the array

MSmits: can also use pointer ofc, but pointers are bigger :)

Default avatar.png punter147: but how do i track deallocations as fragmentation is a real problem for me to manage?

MSmits: you dont deallocate

MSmits: they're just there

MSmits: if it's full, you reset, which means you go back to index 0

MSmits: whenever you make new children you set the node properties to the correct values, you dont need to do anything when you're done using them

MSmits: so deallocation is not necessary

MSmits: if you dont reuse the tree, it should not even be possible to use the full node pool

MSmits: with tree reuse it's possible to use all of them, but that'll happen by turn 20-30 or so and that just means you reset all nodes once. Or you risk it and dont reset at all

MSmits: in that case, you keep reusing, but some older nodes will be at higher indices and the new nodes start at 0. If they mix, you're screwed, but that doesnt happen in uttt

MSmits: just make sure your pool has 20 million or so nodes and you'll be ok

MSmits: to be clear, when i say reset, i just mean your current index is set to 0 and your root is the only node in your tree. You just start that turn expanding from root

MSmits: no need to do anything to the full pool

MSmits: (if you dont reuse tree, every new turn is a reset)

Default avatar.png punter147: oh i see. i did not think of allocating nodes from front. rn i allocate it from back. and i maintain pointer to last used node to help in using first unused node. thanks for the advice MSmits.

MSmits: not sure what you mean by front and back

MSmits: let me just share my node and node array

MSmits: const int NODE_MAX = 35000000;

MSmits: http://chat.codingame.com/pastebin/d33411e1-4bb9-4514-9c1e-34909d6b8710

MSmits: Node nodes[NODE_MAX];

MSmits: so... just a giant array of 35 million nodes. Memory reserved at start, no need to worry about it

MSmits: as you can see, none of the node properties are set, they are just whatever is in memory

MSmits: when i use them, I set them

MSmits: and when I use them again, I just set them again

MSmits: (dont worry about some of the weird properties, such as having boardindex, moveindex and boardstate, my bot is weird)

Default avatar.png punter147: oh i see MSmits thanks for the code snippet. it will be very helpful for me in the future. I will try to implement the ideas you mentioned thanks again MSmits.

MSmits: np

Default avatar.png punter147: no worries every bot is special :smile:

MSmits: true

Default avatar.png punter147: i will get back to improving uttt bot then. have a nice day MSmits

MSmits: you too

PanGami: :smile:

Default avatar.png Menium: has some one a tip for me ^^

Default avatar.png Menium: i see that output is +1 everytime

struct: tip for what?

Default avatar.png Menium: sry i thought this was in game chat

Default avatar.png geekyarthurs: whats up

Default avatar.png geekyarthurs: everyone

Default avatar.png geekyarthurs: i=input;j=int;l=j(i()) for v in range(l):print(bin(j(i()))[2:])

Default avatar.png geekyarthurs: shorten this code

Husoski: @geekyarthurs if you're not using the value of v in that for loop, don't use range(). Use `for v in '*

Husoski: for v in '98

Husoski: for v in 'x'*I()

Husoski: Pardon the oopses. I guessed that you meant range(I()) instead of range(I).

Husoski: Nevermind. That I was lowercase ell. It's still shorter to loop over a length-l string with l*'*' than to type out range(l)

BugKiller_328: when I copy and paste the code from here

BugKiller_328: https://clemg.github.io/pythongolfer/

BugKiller_328: to minify

BugKiller_328: I got an warning like 'detected unusal line terminators'

BugKiller_328: and running is failed with error like 'Syntax Error: unexpected EOF while parsing at ,string> ......

BugKiller_328: any idea ?

KiwiTae: BugKiller_328 whats the golfed code lol

BugKiller_328: tried copy & paste several several times and it worked.

BugKiller_328: but sometimes, I'm getting error like above..

BugKiller_328: one question

BugKiller_328: Is there a way to participate the 'clash of code' for the reverse mode ?

BugKiller_328: I checked my quest and it asked to to win in 'reverse mode'

BugKiller_328: I've participated 20+ times for 'Clash of code' but It was 'shortest code' or 'fast mode'

zsltg: I think it is random, you can only choose it in private mode, but that doesn't count towards your quest as far as I know

BugKiller_328: hmm.. then I need to try again & again and again ?

BugKiller_328: even I solved 20+ problems but I didn't meet the reverse mode yet

BugKiller_328: :(

KiwiTae: BugKiller_328 for the error it prob comes from encoding in utf16, only works if bytes count%4==0 so if you get errors add spaces

Default avatar.png mangiacap: im trying to make guitar hero again but program it with personalized songs

zsltg: BugKiller_328 it took me some time too, eventually you'll get it :slight_smile:

KiwiTae: in coders of the caribbean when you fire or drop mines do you slow down or keep momentum?

Probeg: Россия чемпион

Default avatar.png SamvelMuqelyan: Пашинян варчапет

Default avatar.png DevilJamJar: Someone just got 100% in Clash of Code for raising IndentationError tf

sasuke.programmer: exactly

jacek: oO

sasuke.programmer: can someone explain?

Murat_Eroglu: @DevikJamJar scroll right

Murat_Eroglu: @DevilJamJar scroll right

Default avatar.png DevilJamJar: Oh wow lmao

Default avatar.png DevilJamJar: didn't even know that minus was valid syntax

Murat_Eroglu: it is not valid

Default avatar.png Lucario_41: How do I make an integer = X

Default avatar.png Lucario_41: or X=1

Default avatar.png Lucario_41: int(x=0) ?

Default avatar.png Lucario_41: This is Python 3

NeAlyssa: what do u mean

NeAlyssa: in python u just write x = 0

NeAlyssa: or if it is input x = int(input())

Default avatar.png BobLob: Could someone tell me why the following line generates a bus error in C? -> for( int x = 0; x < 1101741226; x++ ) printf( "%i\n", x );

Default avatar.png BobLob: The bus error is specifically thrown on the prinft(), though I can't think of any reason why it's happening.

BlaiseEbuth: %d

BlaiseEbuth: oh i is an alias

jacek: int initialization in for in C?

Default avatar.png BobLob: Yeah, i is integer. I think I found the issue by removing a large block of storage from the program. I don't know why it was throwing a bus error on the printf instead of the storage block, but removing that block removed the error, so I just changed to another algorithm.

Default avatar.png BobLob: Yeah, you can both create and initialize inside of for() in C

jacek: oh my

BlaiseEbuth: Memory errors are rarely thrown where they realy are...

BlaiseEbuth: More fun like this.

PatrickMcGinnisII: stdout isn't big enough i guess

Default avatar.png BobLob: I was wondering if something like that might be happening, so I started decreasing that large number by half to see when the error occurred. I actually got down to x<2000ish and still got the error, which is what prompted me to look elsewhere. There was no error on the creation of the large array, so /shrug.

Default avatar.png FyrstikkoTheCoder: in coders strike back, i just have got into bronze league, but my pod always stop after colliding with the other pod! Help! btw im writing in javascript

BlaiseEbuth: Safety first. Don't collide and you can keep driving.

Default avatar.png FyrstikkoTheCoder: ok.

Nekko551XD: people i noticed one thing puzzle the greatest number doesn't have proper solution for one case that isn't tested it should be added just to make it bit more difficult case is if we have positive input 2 or more numbers and a dot then for biggest number from lets say "9 0 0 0 1 0 ."would give 91000 instead of 90000.1

KiwiTae: FyrstikkoTheCoder its prob easy to debug ~ just check where your code crashes

PatrickMcGinnisII: BobLob I would try like 500, I know you aren't exceeding the line limit per print statement ... but that would rule out the buffer overflow if the buffer is only 1k. I do agree that the segfault is prolly somewhere else

AllYourTrees: whats the best way to get the position of the nth bit set in a bitmap?

struct: ctz

struct: https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html

struct: ah nth bit set

struct: so its pdep

AllYourTrees: yeah what i'm doing now is clearing lowest bit n times then using ctz

struct: https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=pdep&expand=4152

struct: _pdep_u64((1ULL << rand(__builtin_popcountll(mask))), mask);

AllYourTrees: ty for sharing wow how do you find this stuff

struct: Well I coded it recently

struct: and I think i have used it before

struct: I cant recall how I found it

AllYourTrees: now the question is can i use it in rust :)

struct: seems like rust has it

AllYourTrees: yep got it working ty struct!

Default avatar.png QuickMathzs: heeeeeelloooooo

Default avatar.png masknksnvsndvo: what's the best text editor ?

MiyamuraIzumi: something weird going?

MiyamuraIzumi: my CSB bot go into Rank 26 without doing anything

MiyamuraIzumi: yesterday is 55?

Default avatar.png Kohsmos: who are higher than you went silver league I think

Default avatar.png Kohsmos: oh silver or more higher

MiyamuraIzumi: I am in legend

Default avatar.png Kohsmos: sorry

Default avatar.png Kohsmos: haha..

MiyamuraIzumi: which is the higher?

Default avatar.png Kohsmos: or.. they modified and tested again?

MiyamuraIzumi: must be someone resubmit and win higher rank people but lost to me

Default avatar.png Kohsmos: i think so

Default avatar.png Plantchant: hi

Default avatar.png Plantchant: lick

Default avatar.png Plantchant: lick