Understanding Randomness: 7 Ways to Solve D&D Character

preview_player
Показать описание
We look at 7 different solutions to Exercism's D&D Character exercise - exploring solutions using different approaches to randomness and metaprogramming in Kotlin, Nim, Racket, Tcl, Python, C++ and Haskell.

Kick back and enjoy 30mins of learning with Jeremy and Erik, then go solve the exercise in your favourite way on Exercism.

Links:

Featured solutions:

Timestamps:
00:00:00 Introduction
00:00:53 Kotlin: assign fields directly, ability use random in range and sort + drop
00:05:13 Nim: seed random, explicit side-effects and use sum - min for ability score
00:13:52 Racket: create new character via plain function calls
00:17:51 Tcl: loop over all fields, separate procedure to roll die
00:22:44 Python: dynamically create fields
00:25:41 C++: ensure uniform distribution and keep track of min value
00:35:33 Haskell: define generators
00:44:37 Conclusion
Рекомендации по теме
Комментарии
Автор

Thank you for the video, it was interesting, as always. Seeing it, I got some ideeas on how I could improve my solution also and hopefully I did :).
I liked the way Erik explained the issue with the pseudo-random number ganarators during the C++ solution presentation.
I also found the Kotlin and Python solutions very nice. They are readable and concise.

iosimion
join shbcf.ru