Python Forum
My first try with python
Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
My first try with python
#5
Oh hey, D&D!  I also once wrote a roller: http://dnd.nilamo.com/
It's different from what you're working on, though, as mine was made for character generation (roll 4d6, 6 times for a row, for 6 rows to make a grid, reroll all 1s, and add the three highest numbers to get a stat, then choose any row/column for your base stats).
 
(Aug-07-2017, 08:32 PM)MaxAim Wrote: I thought about that, but I don't really know how to do that
Something like:
>>> response = input("Roll: ")
Roll: 2d20
>>> number_of_dice, type_of_dice = map(int, response.lower().split("d"))
>>> number_of_dice
2
>>> type_of_dice
20
Reply


Messages In This Thread
My first try with python - by MaxAim - Aug-06-2017, 11:15 PM
RE: My first try with python - by wavic - Aug-07-2017, 01:01 AM
RE: My first try with python - by micseydel - Aug-07-2017, 03:47 PM
RE: My first try with python - by MaxAim - Aug-07-2017, 08:32 PM
RE: My first try with python - by nilamo - Aug-07-2017, 09:01 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020