Coding and Roleplaying - Is There a Connection?
TossCobble asks: "With table-top roleplaying giant Wizards of the Coast (makers of Dungeons & Dragons, for those not in the know) broadcasting an open call for adventure designers and developers (including an entertaining developer test to gauge your own game-design talent and knowledge), I found myself once again considering the odd appeal of gaming for us programming types. It's interesting that something so free-form-ishly creative, socially dynamic, and utterly fantastical be fun for folks so grounded in logical programming. Of course, my theory is that gaming and programming actually have more in common than we might think. Tabletop roleplaying involves coming up with creative solutions to problems set in a clearly-defined ruleset, involve constant data-tracking and minor mathematical equations, and involve working together with small groups of people toward like-minded goals. Conversely, love of roleplaying can illustrate how important creativity is to good programming. What do you think?"
A lack of women!
Well, I used to code, and me and the wife like to role play every once in a while, so I guess there is a correlation.
I ... [rolls d20] ... agree totally!
Or am I missing some non-obvious shared characteristic?
Ignore the "p2p is theft" trolls, they're just uninformed
Shhh!
I ban you away from my wow tower! Begone!
http://saveie6.com/
yes, but some code reviews I have seen were very much like that ;-)
Which means that computer programs generated from said satanic code are satanic.
Which means that, if there's a correlation, and Chick comes to this conclusion, his website will be off the net pretty soon.
This sig no verb.
Finally, I am able to help with the amazing mastery of Microsoft BASIC v5.21 on CP/M 2.2 that I had in my youth. I never thought that this moment, and my hours spent in front of the computer writing programs to create D&D characters would pay off 22 years later!
.4, 1.2 and 2.2. That should be 1, 1, 2 for a total of 4. Your function would return 0 + 1 + 5. Yeah, you're adding in those extra 1s, but because they aren't within the INT() they aren't being used properly.
INT() doesn't round, it truncates.
So let's say the 6*RND does return 1.6, 2.4 and 3.3... You're right in that his function would return 2.6 + 3.4 + 4.3 = 10.3... truncated to 10.
Now yours:
INT((6 * RND(0)) + INT(6 * RND(0)) + INT(6 * RND(0) + 3 )
But your function is just as wrong. Suppose RND*6 returns
It should be simply written as this...
INT((6 * RND(0) + 1) + INT(6 * RND(0) + 1) + INT(6 * RND(0) + 1)
Or if you were a master at BASIC, you would do something like this, knowing that this is a routine that you will use over and over again:
DEF FN D(D%) =INT(D% * RND(0) +1)
Then write your line:
D(6) + D(6) + D(6)
I think this is a lesson in, always break things down to their simplest components, and then just do that. Don't try to be fancy and shortcut steps... it makes your code harder to read, as well as potentionally introduces bugs.