User Tag List

Results 1 to 10 of 10

Thread: Imzogelmo's Propsal for FF1 character data template

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #4
    Floormaster Imzogelmo's Avatar
    Join Date
    Sep 2005
    Location
    Earth, currently
    Age
    45
    Posts
    387
    Mentioned
    7 Post(s)
    Tagged
    3 Thread(s)
    vBActivity - Stats
    Points
    1,463
    Level
    12
    vBActivity - Bars
    Lv. Percent
    95.18%
    // num is the number in question
    // place is the name for the digit you want, 1, 10, 100, etc. A well-formed place will be an integral power of 10, but let's not count on that

    int get_digit (int num, int place)
    {
    if (place < 0)
    // choke and die with nasty error
    else if ( place < 10) return num% 10;
    else return get_digit((int) num / 10, (int) place / 10);
    }

    // if you can guarantee that the number requested is 'well-formed'...

    int get_digit(int num, int place)
    {
    return ((int) num / place) % 10;
    }

    // maybe you're expecting places named 0, 1, 2,... instead of 1, 10, 100...
    int get_digit(int num, int place)
    {
    return ((int) num / pow(10, place)) % 10;
    }
    Last edited by Imzogelmo; 01-16-2013 at 05:31 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Armageddon Games is a game development group founded in 1997. We are extremely passionate about our work and our inspirations are mostly drawn from games of the 8-bit and 16-bit era.
Social