Skip to content

dnd-character: split into instructions and introduction #2420

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Apr 10, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Description
# Instructions

For a game of [Dungeons & Dragons][dnd], each player starts by generating a character they can play with.
This character has, among other things, six abilities; strength, dexterity, constitution, intelligence, wisdom and charisma.
Expand All @@ -9,7 +9,7 @@ You do this six times, once for each ability.
Your character's initial hitpoints are 10 + your character's constitution modifier.
You find your character's constitution modifier by subtracting 10 from your character's constitution, divide by 2 and round down.

Write a random character generator that follows the rules above.
Write a random character generator that follows the above rules.

For example, the six throws of four dice may look like:

Expand All @@ -22,10 +22,10 @@ For example, the six throws of four dice may look like:

Because constitution is 3, the constitution modifier is -4 and the hitpoints are 6.

## Notes

~~~~exercism/note
Most programming languages feature (pseudo-)random generators, but few programming languages are designed to roll dice.
One such language is [Troll][troll].
~~~~

[dnd]: https://en.wikipedia.org/wiki/Dungeons_%26_Dragons
[troll]: https://di.ku.dk/Ansatte/?pure=da%2Fpublications%2Ftroll-a-language-for-specifying-dicerolls(84a45ff0-068b-11df-825d-000ea68e967b)%2Fexport.html
13 changes: 13 additions & 0 deletions exercises/dnd-character/introduction.md
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've purposefully made the text a bit dramatic, to keep in line with the fantasy theme. If it's too much, let me know.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll probably water it down a little, just for multilingual speakers (who aren't up to your standard!) But I like the story and the vibe! :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I reverted to my original version

Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Introduction

After weeks filled with eager anticipation, the day has finally arrived for you and your friends to embark on your inaugural adventure in [Dungeons & Dragons][dnd] (D&D).
As newcomers to the realm of fantasy and role-playing, the first step for each of you is to breathe life into your characters by crafting their identities.
The fate of these characters hinges on the whims of 6-sided dice.
Yet, in a sudden twist of fate, you're met with puzzled looks—everyone's eyes are on you, expecting you to unveil the dice.
The realization hits you like a bolt from the blue: the responsibility of providing the dice was yours, sparked by your enthusiasm for D&D.
Your heart sinks as the oversight dawns on you, threatening to unravel the day's plans.
However, not all is lost.
Armed with a rudimentary knowledge of coding, a spark of ingenuity flickers to life.
You decide to forge a digital alternative: a program to simulate the dice rolls, salvaging your D&D adventure from the jaws of cancellation.

[dnd]: https://en.wikipedia.org/wiki/Dungeons_%26_Dragons