bodom658's Profile User Rating: -----

Reputation: 112 Stalwart
Group:
Contributors
Active Posts:
1,123 (0.59 per day)
Joined:
22-February 08
Profile Views:
13,075
Last Active:
User is offline Sep 10 2012 05:43 PM
Currently:
Offline

Previous Fields

Country:
CA
OS Preference:
Linux
Favorite Browser:
Chrome
Favorite Processor:
Intel
Favorite Gaming Platform:
Playstation
Your Car:
Who Cares
Dream Kudos:
375

Latest Visitors

Icon   bodom658 Yep.

Posts I've Made

  1. In Topic: Counting Dice Roll in two dimensional array

    Posted 12 Mar 2012

    No problem.

    Just an fyi, this line is still a problem:

    faces[6][6] = faces[die1][die2];
    
    


    You should read back through and think of why.
  2. In Topic: Counting Dice Roll in two dimensional array

    Posted 12 Mar 2012

    Yes, your seed should only be set once.

    Also, while changing 6 to 7 "works" it isn't necessarily the right answer, as now you have an unused row and column in your array, which is a waste of memory.

    Edit: In light of what jim said, yes, assigning to faces[7][7] is considered to result in undefined behaviour and thus the code is broken.

    So, now you have a 7x7 array, when you needed a 6x6. You don't want to adjust the array size, you want to adjust the index in which you are inserting values. essentially, instead of the dice being numbered 1, 2, 3, 4, 5, 6, you could think of them as being numbered 0, 1, 2, 3, 4, 5, and just adjust the header when you print out your table. (0 would be 1, etc.)

    Even more accurate I suppose would be doing as I have suggested, but think of 0 as 6. This would mean that you do not need the +1 when you use the rand function. You would get a number between 0 and 5 which would naturally map into the array you originally created.
  3. In Topic: How do you showcase your online portfolio?

    Posted 12 Mar 2012

    Having something like a github or bitbucket account with code from your own projects on it can also be very good.
  4. In Topic: Counting Dice Roll in two dimensional array

    Posted 12 Mar 2012

    Hmm... the best hint I can give you at this point is remember that arrays are zero indexed. That means that the first item is at position 0 and the last one is at position 5. Therefore, position 6 is out of range.
  5. In Topic: IDE or Editor?

    Posted 28 Feb 2012

    Vim for life, unless I'm writing Java, in which case I'll use Eclipse or if I am using Qt in which case I'll use QtCreator

My Information

Member Title:
Villiage Idiom
Age:
23 years old
Birthday:
June 5, 1989
Gender:
Location:
Nova Scotia
Interests:
Guitar
Programming
Embedded Systems
Operating Systems
High Level Computing
Years Programming:
2
Programming Languages:
C++, C, C#, Java, Python, Javascript

Contact Information

E-mail:
Private
AIM:
AIM  AlexIce7
MSN:
MSN  ahart07@gmail.com
Website URL:
Website URL  http://exallium.blogspot.com
Twitter:
Exallium

Comments

Page 1 of 1
  1. Photo

    cork Icon

    12 Mar 2012 - 15:48
    Hey,
    I just read your blogpost here about the foobar-app for bada (http://www.dreamincode.net/forums/blog/150/entry-2857-my-thoughts-on-bada-as-an-operating-system-and-as-a-development-platform/).
    I know a lot of time has passed, but do you have any news on that? I'm looking desperatly for ANYTHING to remote control foobar (also hotkey apps, etc). Would be great if you can g...
  2. Photo

    ninos Icon

    17 Feb 2011 - 10:50
    please i need a help for task manager qt
  3. Photo

    BrainTuner Icon

    31 Mar 2010 - 09:46
    hi,
    nice to meet you mate,
    would you mind take a look at my thread?
    http://www.dreamincode.net/forums/index.php?showtopic=165150&st=0&p=974572&fromsearch=1&#entry974572
    Thanks -)
  4. Photo

    Aaronugio Icon

    16 Feb 2010 - 22:32
    Well firstly, like the screen name, they're an awesome band.
    Secondly, good luck to in your college career, you seem alot like myself,except with better social skills, lolz, so I'm sure you'll do great things.
    Thirdly, I really like your attitude, it's hard to find optimist nowadays, with more and more doomsday ranting going on, it's hard to find someone with the w...
Page 1 of 1