These are chat archives for Codewars/codewars.com/kata-solving-help

19th
Apr 2017
EK
@docgunthrop
Apr 19 2017 01:23
people were getting a bit careless with the spoilers in that comment section
Voile
@Voileexperiments
Apr 19 2017 01:23
I think that was meant to be a hint
it's not very subtle though, yeah, everyone who knows enough of JS will instantly recognize that slang term :P
EK
@docgunthrop
Apr 19 2017 01:24
the biggest hint, IMO, was the be evil.
Voile
@Voileexperiments
Apr 19 2017 01:24
yeah
and people always say, eval is evil
so it's hardly subtle at all :P
(of course, after this hint there is still another trick to perform, and that one is also non-trivial)
EK
@docgunthrop
Apr 19 2017 01:25
as someone who pretty much avoids eval at all costs (with this kata being an exception), that was the biggest hint for me
I didn't know about the template literal magic until completing the kata
some random post on a code golf forum did help
Voile
@Voileexperiments
Apr 19 2017 01:27
It was funny that I actually just read the MDN page about tagged template literals and then complained to someone else about this being "magic" just a few days ago
so I've already readily known the trick, I just needed to recall it :P
EK
@docgunthrop
Apr 19 2017 01:28
I noticed that you started an ASCII game series. Do you already have a predetermined number of katas you were going to publish?
Voile
@Voileexperiments
Apr 19 2017 01:29
Let's say I have like 15 in draft
The biggest obstacle is, of course, that I have to solve them myself first before publishing them
EK
@docgunthrop
Apr 19 2017 01:29
These game series are good challenges. myjinxin2015 has a few good ones out there, including a Minesweeper and a Crossword puzzle. I checked out one from another CW user for the 2048 game, but that one's still in beta with some unresolved issues
15 already, that's quite ambitious
Voile
@Voileexperiments
Apr 19 2017 01:30
Yeah, this is a very largely unexplored category, and we do seriously need more non-7/6kyu katas :P
I take inspirations from the immense pile of puzzle games I've played during my childhood/teenage period
EK
@docgunthrop
Apr 19 2017 01:31
the unfortunate thing is the low-hanging fruit is very attractive for people who don't want to spend much time on solving katas
I recall spending at least a couple days figuring out Break the Pieces (2kyu kata)
Voile
@Voileexperiments
Apr 19 2017 01:32
Ahh
I can instantly figure out 2 ways to complete that kata
but actually writing out the logic is soooooo annoying, I'll probably delay doing that even more
and I've played enough Minesweepers (and Hexcells) to know the tricks in Minesweeper, but haven't attempted it yet
EK
@docgunthrop
Apr 19 2017 01:34
I've played plenty of Minesweeper, so I'm familiar with it, but implementing a solution to a Minesweeper kata is something else :/
Have you done the Conway's Game of Life Unlimited Version?
Voile
@Voileexperiments
Apr 19 2017 01:35
yeah, Minesweeper is NP-complete after all
yup, that wasn't hard either
EK
@docgunthrop
Apr 19 2017 01:35
you mean Conway's GoL isn't hard?
Voile
@Voileexperiments
Apr 19 2017 01:35
definitely
I think my biggest gripe to the solver katas at 4-2kyu range currently is that they're basically all bruteforce solvers
EK
@docgunthrop
Apr 19 2017 01:36
there are varying degrees of brute-forcing
Voile
@Voileexperiments
Apr 19 2017 01:36
and bruteforce solvers are boring if you don't put variants between the problems that provides different approaches and optimizations
e.g Sudoku solvers, there are 3 such katas, and they tell people to bruteforce pretty quickly
EK
@docgunthrop
Apr 19 2017 01:37
I've completed one of the Conway's GoL katas, but I plan to use the Hashlife algorithm to complete the next one
Voile
@Voileexperiments
Apr 19 2017 01:38
ohhh, interesting
EK
@docgunthrop
Apr 19 2017 01:38
which algorithm did you use for Conways'?
Voile
@Voileexperiments
Apr 19 2017 01:38
plain simulation
EK
@docgunthrop
Apr 19 2017 01:39
I just wanted to learn it after reading about it on Dr. Dobb's site, and finding out about Golly
Voile
@Voileexperiments
Apr 19 2017 01:39
I don't aim for complicated but efficient algorithms unless I need to
EK
@docgunthrop
Apr 19 2017 01:39
it's still interesting to know about. it's one case of a crazy efficient algorithm
Voile
@Voileexperiments
Apr 19 2017 01:40
oh, btw: would you be interested in uhm, say, numerical integration algorithms?
EK
@docgunthrop
Apr 19 2017 01:40
that sounds interesting. can you elaborate more on that?
Voile
@Voileexperiments
Apr 19 2017 01:40
e.g quadrature rules
and integrators (RK4, leapfrog, velocity verlet, etc)
EK
@docgunthrop
Apr 19 2017 01:41
hmmm, sounds like you're a CS major?
or math major
Voile
@Voileexperiments
Apr 19 2017 01:41
nope, physics major :P
EK
@docgunthrop
Apr 19 2017 01:41
United States?
Voile
@Voileexperiments
Apr 19 2017 01:41
Hong Kong
EK
@docgunthrop
Apr 19 2017 01:42
for school or native?
Voile
@Voileexperiments
Apr 19 2017 01:42
native
EK
@docgunthrop
Apr 19 2017 01:42
ah I see. I'm from the US here, but getting back to your question
Voile
@Voileexperiments
Apr 19 2017 01:42
^ anyways, that's among one of the things I just pointed out at the github issue thread, there is a very large unexplored field on math/stats/science problems, specific paradigms, puzzle solvers
not just project-wide problems or real life-based implementation problems
EK
@docgunthrop
Apr 19 2017 01:43
I would guess a lot of people on CW are beginner coders
so the advanced stuff may be a bit much for many
Voile
@Voileexperiments
Apr 19 2017 01:44
I wouldn't say it's mostly a matter of "beginner coder", I pretty much don't code at all before I joined CW, but I still know most of the standard tricks and algorithms
and problem analysis/decomposition/approach
that probably comes from my vast experience of playing puzzle games
EK
@docgunthrop
Apr 19 2017 01:45
oh wow, you started CW in January and finished that many katas?
that's some dedication
Voile
@Voileexperiments
Apr 19 2017 01:47
well, I'm looking for jobs during this period, so I have lots of time to gear up myself :P
EK
@docgunthrop
Apr 19 2017 01:48
but about the katas you have planned, just don't be surprised if they don't get much love/attention. There are some truly great katas that people don't try because of the difficulty
Difficult katas I dont mind too much, but poorly written descriptions which omit requirements to pass are the ones that irritate me the most
Voile
@Voileexperiments
Apr 19 2017 01:49
yeah, 7/6kyu katas are full of them
also, lack of good tests
It took me a week or two to clean up all the 7kyu katas (and half of the 6kyus) so I have a good feeling how nasty 7-6kyu can be
EK
@docgunthrop
Apr 19 2017 01:51
but why bother with 7kyu at your level?
Voile
@Voileexperiments
Apr 19 2017 01:52
it feels like... junk food, you eat tons of them and they occupy your time but they aren't very beneficial, they're often bland, and some of them are just bad
EK
@docgunthrop
Apr 19 2017 01:52
right...there's not much to gain from 7 kyu and below
Voile
@Voileexperiments
Apr 19 2017 01:52
well, I'm a completionist :P
EK
@docgunthrop
Apr 19 2017 01:52
IMO it's a waste of time because I dont' really learn anything from those
ah I see
Voile
@Voileexperiments
Apr 19 2017 01:53
only got ~600 unsolved approved JS katas
EK
@docgunthrop
Apr 19 2017 01:54
sounds like you plan to complete everysingle kata?
Voile
@Voileexperiments
Apr 19 2017 01:55
maybe, I'm not really actively cleaning them up recently, but rather picking up a few whenever I feel like it
EK
@docgunthrop
Apr 19 2017 01:55
have you tried the Whitespace Interpeter?
that was probably the most tedious kata I've ever done
Voile
@Voileexperiments
Apr 19 2017 01:56
naturally for non-BF inspired interpreter katas :P
compilers are equally tedious too
EK
@docgunthrop
Apr 19 2017 01:57
I've been looking at the Tiny Three Pass Compiler
Voile
@Voileexperiments
Apr 19 2017 01:57
I don't think my mind's ready to write something that parses a language to AST yet, so I'll leave them there as is
EK
@docgunthrop
Apr 19 2017 01:57
haven't tried it yet
Voile
@Voileexperiments
Apr 19 2017 01:57
anything else that only requires writing a FSM is good enough though
EK
@docgunthrop
Apr 19 2017 01:58
some of the FSM ones, that were blue ranking, are surprisingly easy
Voile
@Voileexperiments
Apr 19 2017 01:59
yeah, it seems that the difficulty of blue katas in very early days of CW are all over the place
(now it's 6kyu ones)
EK
@docgunthrop
Apr 19 2017 02:00
there are degrees of varying difficulty for sure. It's not easy coming up with a ranking that will be universally agreed upon
what would you say is the most difficult kata you've completed so far?
I'm always on the lookout for a new challenge, but one that's got decent documentation (clear description)
Voile
@Voileexperiments
Apr 19 2017 02:04
it depends, as for conceptual difficulty there are some really nasty CS-related ones even at 4kyu (e.g functional streams, dependency injection)
EK
@docgunthrop
Apr 19 2017 02:05
I'm in the process of working on the Dependency Injection kata
and also the Advanced Events kata
Voile
@Voileexperiments
Apr 19 2017 02:05
Yeah, I've seen that kata before, can't remember if I've solved it
EK
@docgunthrop
Apr 19 2017 02:06
another game-related kata by myjinxin
Voile
@Voileexperiments
Apr 19 2017 02:06
yes apparently, and that one's not hard at all
looking at my solution I think advanced events probably only took me about 10-20 minutes or something
Hmm, this one is easy, just connect all the "in"s via a graph
a single floodfill should work
EK
@docgunthrop
Apr 19 2017 02:09
yeah I figured something related to the break the pieces kata might work here
Voile
@Voileexperiments
Apr 19 2017 02:09
there are two ways to solve break the pieces
constant floodfilling, or decomposing the edges and vertices
finding how to draw over the edge of a specific area is mostly easy if you don't need to handle weird edge cases, it's all about counting adjacency
Voile
@Voileexperiments
Apr 19 2017 02:15
I'm more interested at pathfinding pre-processing techniques atm though
e.g decomposing problems into graphs, generating waypoint maps, etc
Voile
@Voileexperiments
Apr 19 2017 06:52
https://www.codewars.com/kata/i-spy ouch, so this is 6kyu and this is definitely not a easy one
Voile
@Voileexperiments
Apr 19 2017 06:57
especially with the final set of requirement tests