@namark I am doing that other one on REPL.it right now if you care to come join me :)
https://repl.it/join/evjnthdk-reasintper
@namark that one is simple, why not give this a try:
Here is a link to REPL.it Where it has been done via TDD
Short of walking you through it, here is one instance where it was walked through. You can see the the unit tests that were used, unfortunately, there is not a really good way to see each of the coding steps and refactorings. I think I will have to do a Git solution that does a commit on each phase-step.
There are a couple commented solutions that are further ideas I wanted to keep.
@freemo @namark @Lossberg I realize you enjoy different types of problems, and different types of solutions. So maybe even the suggestion of this is something you may find no interest in. I can accept that. I would encourage everyone, even you to give it a try (at that absolutely ridiculous level of pragmatically following the 3 laws and using the R-G-R workflow) Maybe you will get something out of it, maybe you won't.
And by pragmatically, I mean your first test would look like:
def test_factor_zero_return_empty():
assert factor(0) == []
----
and the first code that makes it pass is:
def factor(num):
return []
-------
That is the level or pragmatism I am speaking of.
@freemo @namark @Lossberg The factorization problem/kata is one that I particularly enjoy, because when I am done, and I look at the 6 lines of python that it generates... I always shake my head and say "I would not have written that no matter how long I sat there, or how many times I tried." Humor me, and let's see if you see similar things....
@Lossberg by the way, I do a #toyprogrammingchallenge here, you can look at the origination of it all the way back the 'Ninety-Nine Bottles of Beer" challenge. https://qoto.org/@Absinthe/102805659580967435
Feel free to play at any of them that interest you. There is no timebox on these. Watch for the tag #toyprogrammingchallenge and include it on any answers you offer to any of them.
When I say TDD, I mean it is the way of design and development. (maybe even a way of life :D )
This means following the 3 laws:
1. You are not allowed to write any production code unless it is to make a failing unit test pass.
2. You are not allowed to write any more of a unit test than is sufficient to fail; and compilation failures are failures.
3. You are not allowed to write any more production code than is sufficient to pass the one failing unit test.
Using a Red-Green-Refactor work flow. Write just enough of a unit test for the simplest unit test. Then see that test fail(Red). Then write the SIMPLEST solution in the code to make it pass. (Green) Then refactor to remove complexity and simplify. Lather, rinse, repeat.
@freemo I am trying to get one started somewhere else, and in that particular place it will have to be FOSS.
However, I would have no problem doing it as a for profit thing, but that sounds more like the definition of a "Coding Business" I wonder if it could make any money? :)
@freemo I guess, why not? Adds another layer of complexity to things whenever money gets involved though. :)
The green faerie