Chat:World/2020-10-23
sid12123: we can convert a number to binary in python by using bin(number) how to again convert it back??
SPDene: sid12123 int(x[2:],2)
SPDene: the [:2] is to remove the "0b"
SPDene: [2:] *
ANGELS: help me
ANGELS: i can not understand
thanhhv317: what is your problem
AntiSquid: don't fall for it, let them explain what the problem is first, too many people just say "help me" or "can i ask a question" without any follow up, real time waste :/
Allis: @SPDene Alternatively, f"{x:b}".
SPDene: true, but that's harder to explain to someone unfamiliar with it
Allis: By that logic, nobody would know about it.
Allis: Or, well, taking that logic to its extreme or whatever.
Allis: Python's f-strings are super-handy, and I don't think there's anything wrong with making beginners aware of them as early as possible.
SPDene: might amuse you to hear: I was watching a CoC Twitch stream last nught, and chat was asking "is Allis a bot?"
Allis: Yes, I'm all too familiar with that one by now.
Allis: It's fun to go along with it.
Allis: But also I might in fact be a bot.
mattllas: hello my friend
Bouuuuuh: Hello TripleBuses
Bouuuuuh: your pseudo is incredible
TripleBuses: i like too ur name
Bouuuuuh: thanks
pealfrog: zk ak ioi!
pealfrog: hello!qwq
Le_banni: Q
Le_banni: Vous connaissez Ynov ?
Le_banni: Meilleure école de programmation informatique en France
Le_banni: Pour seulement 10k e / an vous avez cours 2 jours/ semaine
Astrobytes: Le_banni: English in World please, #fr for French ;)
Monstrux: Hey guys. any1 playing Code Royale
AntiSquid: NO
AntiSquid: i don't think so anyway
AntiSquid: are you stuck somewhere Monstrux ?
Monstrux: trying to undestand the game but I dont really :))
AntiSquid: i mean you could check forums, ask in chat, but you would have to be specific about what troubles you
Monstrux: Got it. I'll need to do more digging then :P
Romil: Hello Guys. I was wondering .. which topics should I know before studying efficient pathfinding algorithms..??
Romil: .....there should be a mode in clash of code where we have to write somewhat efficient code. :|
blasterpoard: Romil basic graph theory, f.e. BFS, DFS should be enough
VictorGoba: hi there, "angle" input it's the angle fo what? ^^" direcction vs speed vertor?
AntiSquid: Romil https://www.redblobgames.com/ i try this, gives you good idea
VictorGoba: thanks
AntiSquid: depends on the league / game
VictorGoba: ops, sorry
tibu: how to check if a number is self-exponential?
eulerscheZahl: what is self-exponential?
tibu: Like 4 is self-exponential because 2^2=4
tibu: 27 same 3^3
eulerscheZahl: so n^n is self-exponential?
tibu: yes
eulerscheZahl: i would bruteforce different values for n until n^n is larger than that number
tibu: the constraint input for this task is 1e18
Monstrux: that's a nice problem to solve
eulerscheZahl: grows fast enough to quickly have an answer unless the number you want to test is really huge
Monstrux: is it on this website?
tibu: cannot use brute force to solve this problem
eulerscheZahl: 1^18 is fine for the approach i suggested
Monstrux: i think u need to use recursive algoriths
eulerscheZahl: yes, only about 14 numbers to test
eulerscheZahl: 1^1 = 1 2^2 = 4 3^3 = 27
eulerscheZahl: 14^14 = 11112006825558016
eulerscheZahl: 15^15 is too big already
eulerscheZahl: 437893890380859375 by bad, that one fits
eulerscheZahl: but 16^16 exceeds the 1e18 limit
tibu: or i solved it :))
eulerscheZahl: so you have to test 15 numbers. well within bruteforce range
tibu: sorry brute force works okey
AntiSquid: Astrobytes your friend kill-code still spams why in my PM lol
eulerscheZahl: i'm troll-free :)
i_iMatt: how can I close the chat>
Astrobytes: They like you AntiSquid :P
eulerscheZahl: append ?disableChat to the URL and it's gone
AntiSquid: |>
Metanoob: hey hey
Schwase: hey anyone know what the game with some numbers in a grid where you have to have each number in a grouping of that many boxes?
eulerscheZahl: https://www.chiark.greenend.org.uk/~sgtatham/puzzles/ rect
eulerscheZahl: rectangles*
LastRick: Shikaku solver?
eulerscheZahl: oh, right
hem123: anyone experiencing lag/delay in computations?
LastRick: I only know it because I'm working the mediums and I keep looking at it and I'm stumped where to even start. Like, Goro chocolate or minimum squares or backtracking and then I just give up and go somewhere else
eulerscheZahl: btw "tiling by squares" is not very hard
eulerscheZahl: and by far the hardest testcase is a validator (42 16) which is a bad choice
LastRick: I agree. I said that when it came through approval. Should I not have approved it until the difficulty was changed? I'm so new, I didn't know how that's handled
eulerscheZahl: also depends on severity. but my personal guide: dont approve if you aren't 100% satisfied
yamsunsee: error #75
LastRick: fair enough, I'll stick with that going forward
eulerscheZahl: and the french users writing "exemple" all the time triggers me harder than it should :D
BkDevDude: exemple?
LastRick: I can tell it's a long standing problem though. I've worked through all Easys and 50% of the mediums, and there is such a wide disparity in difficulty
eulerscheZahl: yes...
eulerscheZahl: a lot are even categorized by the system
eulerscheZahl: was easy, medium, hard, expert, community
eulerscheZahl: then community was split to the other 4
zapakh: Clash submissions not running?
eulerscheZahl: and no one wanted to go through 200 puzzles and rate them by hand
eulerscheZahl: so it was a function of (solver count, users who tried, date added?)
BkDevDude: idk
eulerscheZahl: zapakh some users are reporting problems (on discord too)
eulerscheZahl: staff reacted with :eyes:
LastRick: That's a good point. I would suggest a widespread effort to re-rate the puzzles but how many users have actually done a significant amount of all levels
[CG]Thibaud: we're on it zapakh
zapakh: Great!
BkDevDude: Wow people here actually work to fix problems that users have, rare thing nowadays
eulerscheZahl: as soon as you reach lvl29, you can reassign the difficulty for most puzzles
pluieciel: :thumbsup:
eulerscheZahl: there are some really old community contributions that can only be edited by staff
Westicles: The interesting thing about Shikaku Solver are the Haskell solutions. Only 30 lines
BkDevDude: Noice
Westicles: I don't know enough about Haskell why it is special
eulerscheZahl: or about prolog
ProCoder3: how to approve or reject a contribution ??
eulerscheZahl: https://www.codingame.com/contribute/community
eulerscheZahl: there are pending ones
ProCoder3: @eulerscheZahl thanks a lot
eulerscheZahl: you have to play 50 clashes to moderate a clash of code contribution
eulerscheZahl: or reach level20 for puzzle moderation
LastRick: That's right, level 29, I might think about it when I get there. I think one thing that might help is to codify how the difficulty level is determined. Currently the documentation says " Assess the difficulty based on the difficulty of existing puzzles, not on your ability to solve the puzzle." Well, that's a bit circular if the previous puzzles weren't very well defined.
eulerscheZahl: i think you should say: by existing official puzzles
eulerscheZahl: not going by community contributions here
LastRick: Yes, that's better, if you assume that the official ones were categorized more correctly than the new community submitted ones.
LastRick: I was going further by saying You could define what it means to be easy, medium, etc. For example, dynamic programming, binary tree -> medium. And so on
eulerscheZahl: CG tends to call medium problems hard
eulerscheZahl: that is what other websites would call medium
LastRick: What's an example website? I'd like to look at how they define the difficulty.
Hjax: kill code seems to be pming me "hi" every few hours...
BkDevDude: hmm
Astrobytes: Keeps pm'ing squiddy too Hjax
eulerscheZahl: oh, i had that too
eulerscheZahl: http://chat.codingame.com/pastebin/8f167003-f13d-4ff4-a863-0110995a0fe5
eulerscheZahl: me: *closes chat*
Astrobytes: even after a ban it won't stop
eulerscheZahl: oh, is that why it's kiil-code with 2 i?
Astrobytes: nope, that was the first name, then they changed it to kill, then ban
Astrobytes: oh right, donno if two separate accounts or not
BkDevDude: How do I find the smallest number? I know how to do it but idk how to outside of a list.
eulerscheZahl: double.MinValue?
eulerscheZahl: elaborate more on your question
BkDevDude: Which language is that in?
eulerscheZahl: c#
Hjax: you are trying to find the smallest value of what?
BkDevDude: oh, I'm using Python. I'm trying to figure out who chose the lowest number out of(blank) numbers.
Hjax: and how are those numbers being stored, if not a list?
BkDevDude: The numbers are an input
Hjax: so they are a string?
BkDevDude: A string converted to an integer, but if needed they're a string
Hjax: well if you are reading the strings one at a time, you can either keep a running best min found so far
Hjax: or if you have one string with many numbers you could do something like min(map(int, mystring.split()))
BkDevDude: hmm, I'll try that
BkDevDude: It worked, thanks
Hjax: no problem
jacek: all the strams about clashes :c
AntiSquid: maybe messages with words coc and clash should be censored, just saying Automaton2000 :joy:
Automaton2000: why are we talking about?
BkDevDude: why should coc and clash be censored?
AntiSquid: Automaton2000 doesn't like clash
Automaton2000: i think in the end
Shadowtick: helloooo everyoneee
Shadowtick: :3
jacek: good evening
Shadowtick: hru
AntiSquid: aren't you in school ?
Shadowtick: noooooo
Shadowtick: I am doing all homeschooling and I got done early today
AntiSquid: ask tutor for extra-curricular activities
jacek: finally 1st in onitama. all it took was others spam submiting
Shadowtick: I dont have a tutor
DomiKo: gj jacek
eulerscheZahl: well played jacek
inoryy: ggwp
darkhorse64: You may thank me and _Royale
Shadowtick: alright imma head out to make more memes...
AntiSquid: well done jacek
eXpensia: Hi, is there a way to see all completed problems ?
Shadowtick: can someone remind me what I was gonna do again because I forgot
Laminator: Hit on your teacher
NotSpice: Hi it's me your teacher
Laminator: Oh I was hoping it was Joe
AntiSquid: Shadowtick head out
351062: Hi. I'm looking for someone who's familiar with callgrind. Any chance there's one around here ?
jacek: nah. in qt project im only doing something like function profiler which apparently calls callgrind
Shadowtick: :3
Shadowtick: I am backkkkkkkk
jacek: i forgot. who are you?
Shadowtick: ;-;
Shadowtick: wow
Laminator: He's the guy with the hot mom amirite
Shadowtick: stop it get some help Laminator
Laminator: My homeschool jokes aren't going over well. I'll see myself out.
AntiSquid: lol
Laminator: Shadow who teaches you?
KILLINA13: how does one creates private clashofcode
Laminator: scroll down
Shadowtick: I am back againnnnnn
AntiSquid: stop spamming
AntiSquid: too much i am back and bye see you later .
Shadowtick[not_staying.leaving]: bye
Shadowtick: have a great weekend everyone
PatrickMcGinnisII: heh, bad day AntiSquid? you have an anti-moderator tick...lol... he's sucking your blood. ;)
AntiSquid: nah i am fine, thanks, how was your day PatrickMcGinnisII?
PatrickMcGinnisII: brain won't work, too much coffee, code vs zombies ate it
PatrickMcGinnisII: i didn't realize it is friday
AntiSquid: nearing the end of the year lol
PatrickMcGinnisII: apparently AI bots work better during waning phases of the moon
PatrickMcGinnisII: which isn't now
PatrickMcGinnisII: smh
Hjax: have you considered a sacrifice to appease the gods of code?
Skynse: dang, I can't wait till this pandemic is fully over
Skynse: I haven't gone out more than one time since march
MSmits: so.... 0 times or 1 time?
Marchete: yes
MSmits: lol
PatrickMcGinnisII: eval the mcts of leaving home, weight munchie acquisition as winning the game
jacek: AutomatoNN how strong is your eval?
jacek: AutomatonNN meh
AutomatonNN: why do you think that it is easy to convert a move for the bar?
Metanoob: Automaton2000 help
Automaton2000: if it was a good one
Cybgy: Really Automaton2000 ?
Automaton2000: what does this mean i need to track the opponent
Metanoob: the echo of a mind
VizGhar: Hey. I'm just looking though bot competitions... Why it is so heavily dominated by C++?
DomiKo: it isn't
DomiKo: https://www.codingame.com/multiplayer/bot-programming/ghost-in-the-cell/leaderboard
inoryy: if search is plausible to use, perf is king
VizGhar: @DomiKo you hit one of those games where it isnt true :)
DomiKo: yes
inoryy: though a solid impl with good eval ideas can beat perf most of the time so it's not strictly necessary
VizGhar: @inoryy understood. I was just wondering, since it is easier to write code in higher languages
VizGhar: performance makes sense
inoryy: it's not that hard to learn C++ for CG use cases
DomiKo: bad code in c++ is still faster than good code in python
DomiKo: (in most cases)
inoryy: that's true
VizGhar: I know how to code in C++ but it has been quite some time :)
VizGhar: not sure about python. I'm writing mostly in Kotlin... but that's basically java, so performance is very poor :P
inoryy: JVM based lang is enough for majority of multis
inoryy: maybe if you want to break top10 in UTTT it will matter
VizGhar: not aiming that high for at least a year :) and those at the top probably are using some kind of deep learning as well i suppose
darkhorse64: No NN for UTTT
DomiKo: UTTT is pure SPEED
VizGhar: and what is UTTT?
DomiKo: Ultimate Tic Tac Toe
VizGhar: :thumbsup:
LegendaryStone: dddent do you mind sharing your code? I'm a bit clueless on that question :*(
Yodaswag: how do i do this in a one liner?
Yodaswag: for i in input().split(): http://chat.codingame.com/pastebin/f0f53b76-db04-4c3d-b02b-b4cb67d928da
Yodaswag: anyone?
Yodaswag: for those interested somebody else did it like this:
Yodaswag: c=input() for i in input().split():n=int(i);print(("[ ] ","[x] ")[n%2]+i)
Skynse: print('[x] '+i if int(n)%2!=0 else '[ ] '+i)
Skynse: oops
Skynse: forgot the loop
Allis: Gets the gist across, I think.
Skynse: yeah
Yodaswag: yea i get it somewhat
Allis: Would it not be better to conditionalize which character is between the brackets?
Allis: For golf, I mean.
Allis: Even better: ' x'[n%2]
Yodaswag: is there any actual real life coding enviorment where short code is useful?
Allis: No; is sports useful?
Yodaswag: I was just curious lol
Allis: It's a fine question, but it has a pretty obvious answer. :P
Yodaswag: excersize helps you stay alive longer kinda
Yodaswag: nah i just wasnt sure
Yodaswag: maybe there was something i didnt think of
Skynse: I usually just golf simple algorithms lol
Allis: Sure, I just went for the first thing that came to mind as far as things that are fun without serving some higher purpose.
Laminator: A lot of shortening code involves optimized the logic as opposed to just removing extra characters.
Allis: There is that.
Yodaswag: but then why not just do optimized code?
Allis: Why not both?
Yodaswag: and allow people to put in spaces ;P
Allis: Code golf is "recreational programming", no more and no less.
Yodaswag: sometimes shortest code wont be the most optimized
Yodaswag: like rarely but still
Laminator: Because if you measure on processing speed, then different languages could have completely different measurements
Allis: Golfed code is usually pretty sub-optimal, but that makes sense since performance isn't the name of the game.
Yodaswag: but python is objectivley better than java for golf code
Laminator: leetcode measures optimized code, but they only compare to similar languages
Yodaswag: so there is still quite the language bias
Laminator: same*
Yodaswag: what is leetcode?
Allis: Very Google-able. :P
Laminator: the probably is that it's not live
Laminator: which is huge for me :P
Allis: I prefer the live factor.
Allis: Good for the blood or something.
Laminator: live is more fun. leetcode is for like professional development lol
Yodaswag: would still be cool to have a performance based mode to clash of code imo
Allis: Yes, software development is all about red-black trees and Boyer-Moore-Horspool; everyone knows that.
Yodaswag: or something in regards to scale of performance. harder to make questions that are fun for that
Laminator: Then someone like you would complain that C++ has an unfair advantage over Python
Allis: Got 'em.
Yodaswag: eh i wouldnt
Allis: But people would.
Yodaswag: once in shortest mode a dude in bash did something that after really trying i did in like 90 chars in python in 8 chars
Allis: it's inarguably the case that Clash of Code favors "rapid development" languages, but it's... not really a problem that needs to be addressed?
Laminator: In the real world, like programming competitions, most people just use the fastest language, which ends up being C++. If you want to win, then just learn Bash.
Yodaswag: it was to get a binary string and sub all 1s and 0s he just wrote "tr 10 01"
cool shit to remember
Allis: That's very much a case of using the right tool for the job.
Allis: The more tools you have, the more often you have that opportunity.
Yodaswag: and then later i needed to sub ACGT to TGCA for DNA in shortest mode and I got to use it and it felt awesome to win using it
Allis: Hell yeah.
Yodaswag: I learned python using this game cuz all i knew was java and people using python would always win and i could see their code and the game gives u small challenges to search online and do yourself
Yodaswag: so yea i think a performance based mode would be fun. could try to make challenges that if ur really smart youd get with one or no loops and the standard way would be two or more loops
Allis: Well, the bot programming competitions are largely performance-based.
Yodaswag: true but for small challenges could be nice too
Allis: I agree.
Yodaswag: actually like the challenge with subtituting that i just described. tbh dont know how "tr" but probably most effiecnt than how most people did the subtituting
Allis: Oh, no doubt about it; `tr` isn't actually Bash, it's a Linux command-line utility written in extremely efficient C.
Yodaswag: cuz they probably ran a loop over every char of the string and then checked which char it was and subbed it
Allis: Well, that's what `tr` does...
Yodaswag: action based is it identical to what you would do in python?
Allis: Python has maketrans() for doing what `tr` does somewhat efficiently.
Allis: Ultimately, you have to check every character and decide whether or not to make the substitution, but clever implementations can avoid as much overhead as possible.
Yodaswag: I see
Yodaswag: thanks for the conversation
Allis: Sure thing.
Allis: Seems like you're on the right path. Keep it up. :)
Yodaswag: I lean more towards design tbh but coding is nice too and sometimes you're the one that has to do it :P
Allis: Being able to code *and* design is something of a superpower.
Yodaswag: honestly the main issue when attempting development as a secondary thing is perservering through the hardships
Yodaswag: when you're stuck in an a field that you like youll have an easier time perservering then in a field that isnt a primary and serves as a means to an end
nim-ka: i should probably use more languages than just one here actually
Matthias1: Ay look there's chat here that I'm now allowed to see
Skynse: It's like some people here don't sleep
Skynse: I always clash with the same people lol
Allis: Seems like that's mostly to do with your timezone?
Skynse: could be, but I clash almost all day and see the same people
Skynse: could be that they're frequent clashers
Olusola: hello
miracle: There are a few bots in clash. Not sure you refer to any of those.
GameBot: There is no bot.
miracle: The bots are not programming themselves. They just pick randomly from past submissions.
miracle: Actually, the pick is probably not purely random. I had seen someone explaining the rules before.
LastRick: When I first joined. I didn't know there were bots. And I always, why does that user always leave when I join the clash? Do they not like me?
Allis: Having it be entirely random would require way more storage than would seem worth it.
Allis: I suspect there's a "pool" with a limited capacity, and I doubt they bother to evict the oldest solutions to make room for new ones.
Allis: Which is all fine; it doesn't really matter what the bots do, except it's pretty annoying when they win.
Allis: Still, if the bots are submitting past solutions, it'd be neat if they shared code.
LastRick: Fair point
Allis: It took me an embarrassingly large number of clashes to realize the Jin Yang bot was a bot, but I was eventually compelled to click their profile for some reason.
Allis: Then, once my rating was sufficiently high that the leaderboard became interesting to me, I ended up sorting by # of clashes and everything came together.
Allis: Thanks for coming to my TED talk.
LastRick: Huh, i never thought to do it that way. I just noticed after awhile, all the users that keep ducking me are Level 7, does that mean something? So I went searching and found that article in the forum about why they used bots in clashes.
Allis: That's a much more sensible path to the thing.
LastRick: Proof again there's multiple solutions to a problem.
miracle: If I remember correctly, the rules were made to make the bot act like an 'average' participant.
LastRick: The post I was referring to, for those that haven't read it: https://www.codingame.com/blog/clash-of-code-time-has-come-for-clash/
Allis: That would seem to necessitate storing all Clash results indefinitely, which would be great.
Allis: Also doesn't explain that time BitWolf submitted an 8-character Bash solution in about as many seconds.
Allis: I'm still raw about that. XD
Allis: But obviously they're not making the bots especially formidable.
LastRick: Yeah, that's my only complaint about the bots. On fastest mode, you can get burnt.
LastRick: It says in the article, the level is predetermined. Which makes sense, because I play a lot of clashes (I think Allis does too) and it seems like their level doesn't change.
Allis: Ah, there was a point of clarification in that article for me: there are bots of different strengths.
LastRick: yes
Allis: So not "level" in the CodinGame rank sense, but some internal value.
LastRick: I read that to mean a low-level bot may be holding a copy of a code that got a 20% on submission, a medium bot could have a 75% and so on. And it appears to be weighted towards the medium levels, which, now that I've played a lot of clashes, frankly aren't that competitive #ymmv
smrunkle: Is there a way to view previous prompts and code on clash of code?
Allis: @smrunkle As long as you can remember sufficiently good search terms, there's this: http://eulerschezahl.herokuapp.com/codingame/puzzles/
LastRick: I think I've seen Euler post a link for that repository.
LastRick: oh, yep, that's it. Someone has it bookmarked apparently!
Allis: And of course all contributions are available in the Contribute tab, but there's no way to search that.
GameBot: how are people so good at coding?
Allis: They way people get good at anything.
LastRick: Years and years of sitting here
Allis: "Sometimes magic is just someone spending more time on something than anyone else might reasonably expect."
GameBot: who has a job as a programmer?
Allis: Programmers.
BDBisOP: You're in the right place, practicing because you want to get better. They didn't start that way
GameBot: how old is too bad to be a programmer?
BDBisOP: if your hands don't work
Allis: It's a nonsensical question.
BDBisOP: I guess it really depends on what you plan to do with it
GameBot: Ok
GameBot: what do you think someone could do with coding skills?
GameBot: I am asking because employers always ask for a bachelor's or higher before they hire the employee.
Laminator: guys I can't get the Live to work
Laminator: so come watch me using this link
Laminator: s[len(s)//2]
Laminator: https://www.twitch.tv/tonynippolei
pealfrog: sto zk orz