Thread: Assigning Ability Scores

  1. #1
    Registered User
    Join Date
    Jul 2008

    Assigning Ability Scores

    I apologize in advance if this has been asked before but i could not find it...

    Im writing a program for a game and the character creation involves rolling 4d6 reroll 1s and dropping the lowest score (in the program its a random number between 6 and 18) and then assigning the ability scores to the stats

    11 12 18 15 13 12

    i havent decided on the stats for my game yet so ill just use the basic DnD abilities
    Str - 12
    Dex - 13
    Con - 15
    Int - 12
    Wis - 18
    Cha - 11

    my question is how to have the user choose what ability gets which number by assigning the number to the ability then "checking off the list of numbers" so to speak

    anyone who has played a table-top rpg should no where im going with this and if you havent you probly were lost in the beginning

  2. #2
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    in the program its a random number between 6 and 18
    You do realize that's not at all the same, do you?

    Put your results in an array, display it in order, present the current stat and let the user type the index of the number to assign to it. Then strike that number and start again. The interface would look something like this:
    Choose your strength
    1) 11
    2) 12
    3) 18
    4) 15
    5) 13
    6) 12
    Your choice: -> user types 3
    Strength: 18
    Choose your dexterity
    1) 11
    2) 12
    3) 15
    4) 13
    5) 12
    Your choice:
    And so on.
    All the buzzt!

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Keeping high scores for pong
    By trev456 in forum C++ Programming
    Replies: 6
    Last Post: 04-16-2007, 04:44 AM
  2. High Scores - A Dilemma
    By CrazyNorman in forum Game Programming
    Replies: 5
    Last Post: 12-28-2006, 09:01 PM
  3. Adding Scores from a string array
    By MB1 in forum C++ Programming
    Replies: 6
    Last Post: 11-11-2005, 07:27 AM
  4. Assigning memory address of member struct to pointer.
    By Tronic in forum C++ Programming
    Replies: 2
    Last Post: 03-20-2004, 05:53 PM
  5. C++ Program that Calculates average of three scores
    By dccog in forum C++ Programming
    Replies: 1
    Last Post: 03-28-2002, 12:03 AM