eriksoe / ErlangQuest

Learn Erlang through this set of challenges. An interactive system for getting to know Erlang.
33 stars 6 forks source link

quest:list should hide or mark completed quests #10

Closed pmech closed 11 years ago

pmech commented 11 years ago

quest:list currently lists all available quests, but having just finished a quest I only want to see quests i still need to complete.

I suggest that quest:list only lists open quests as default, and takes the option 'show_all' for displaying all quest. When showing all completed quests should be marked.

eriksoe commented 11 years ago

I completely concur :-)

pmech commented 11 years ago

Excellent, better to have something to improve, than to not anything at all! I think 'list' is fine for now.

pmech commented 11 years ago

Done. PR plz.

I did the version where list takes an option argument.

eriksoe commented 11 years ago

What you have done works, but the output is not what I had in mind:

---Quest---------------------------Variant-----Ptr--------
   answer_the_input                slow        1
   answer_the_input                fast        1

I'd far prefer one-line-per-quest. Variants is a minor thing.

Having said that, I probably need to follow up by suggesting a possible such output format. It could be displayed in many ways. If I were to disregard the implementations so far, I might suggest something like:

---Quest--------------------------Pts----Variants----
    answer_the_input                 2         slow(50%), fast(50%)
*   any_reference                    1/2         *slow(50%), fast(50%)
**  impure_list                          4/4         *slow(50%), *fast(50%)

with columns

This is more work to implement, but is (I hope) both readable and would work even if (a) we change to more flexible variant system, (b) we changed to more flexible system for distribution of points on variants. And it probably gives a better feel about variants.

What do you think?

pmech commented 11 years ago

I think what you suggest is much better than what I did. I'll not have time to do this for Lars EUG tonight, but I can do a one-line per quest improvement. Stay tuned.

I did the last_value_wins quest yesterday evening, and found it difficult to do in a clean way, because you had to keep the order of elements (so you have to do more than just overwriting values in a dict). I think I made a O(n log n) version, and it would be really cool if I could get an achievement/variant for having it done in optimal time complexity. So variant: manually, automatic, BigO(n Log(n)). Maybe a space complexity could also be interesting for some quests.

pmech commented 11 years ago

Well, I ended doing everything you suggested. What do you think.

eriksoe commented 11 years ago

Excellent, thanks! The only thing missing appears to be the "*"s at the completed variants. I think the upcoming milestone can easily do without that. :-)

pmech commented 11 years ago

And, now with variant bullets as well.