Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
You cannot "import typing" in Python 3.10 when testing.
Error below:
Traceback (most recent call last):
File "/workspace/default/tests.py", line 2, in
File "/workspace/default/solution.py", line 2, in
File "/workspace/default/preloaded.py", line 11, in
File "", line 1027, in _find_and_load
File "", line 1002, in _find_and_load_unlocked
File "", line 945, in _find_spec
File "/workspace/default/.venv/lib/python3.10/site-packages/_distutils_hack/init.py", line 88, in find_spec
TypeError: str.format() argument after ** must be a mapping, not int
Is there a limited, unlimited, or undefined number of vars allowed to be defined?
This comment is hidden because it contains spoiler information about the solution
Looks like I submitted this accidentally without refactoring (hence allot of debug code). I'll fork it soon. (Edit: forked.)
This comment is hidden because it contains spoiler information about the solution
The first line provided is: f=_=>
Does this violate the only-one-char-per-line rule or is it an exception?
On the Python version, I am very confused about what the return type of parseRegExpr should be. Are we returning ASTs? Are we matching a regex? Are we transpiling from one regex flavor to another as noted by the testcase of shouldBe("a|b", "(a|b)")? The kata details is missing a section about the statement returned, and only mentions that invalid regexes return "".
I'm looking at the basic tests and I think it converts the returned value into a string, then compares it to the second "shouldBe" argument. Should there be a __str__ implementation in the AST nodes that converts an Any() as a "." for example?
My current implementation is returning the AST.
Did anyone get it?
This just made my day. Might try something like this sometime!
I like the parser-like rules approach and minimal boilerplate. Nice job using only 2 headers!
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Good Kata! A C++ version would be nice.
Nevermind, as far as I can see, only one function is needed.
Is the input program one-function or multi-function? For example, is "[ a b ] a + b [ x y ] x * y" possible input or is only one match for the "function" rule allowed? I am not seeing any explicit indication of this in the description.