bodom658's Profile
Reputation: 112
Stalwart
- Group:
- Contributors
- Active Posts:
- 1,123 (0.59 per day)
- Joined:
- 22-February 08
- Profile Views:
- 13,075
- Last Active:
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
-
iKyriaki 
04 Mar 2013 - 02:03 -
darek9576 
05 Jan 2013 - 04:07 -
Brilliantwarrior 
10 Dec 2012 - 15:11 -
atraub 
10 May 2012 - 16:19 -
Braber01 
20 Apr 2012 - 20:41
Posts I've Made
-
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. -
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. -
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. -
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. -
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:
-
AlexIce7
- MSN:
-
ahart07@gmail.com
- Website URL:
-
http://exallium.blogspot.com
- Twitter:
- Exallium
|
|


Find Topics
Find Posts
View Reputation Given

|
Comments
cork
12 Mar 2012 - 15:48I 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...
ninos
17 Feb 2011 - 10:50BrainTuner
31 Mar 2010 - 09:46nice 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 -)
Aaronugio
16 Feb 2010 - 22:32Secondly, 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...