|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Confusing but Simple Program Request?
I been running for loops all day tring to figure out this program.
What i want it to do: 1. 3 number combination 2. numbers range from 1-36 3. Prints out all possible combinations For example: 1 1 1 1 1 2 1 1 3 ......and eventually reaches 36 36 36 I believe this is called algorithm combinatics or something. This program is very simple but so confusing i cant get it right. |
|
#2
|
||||
|
||||
|
This sounds like an exercise in nested loops. I urge you to give it a shot, it's not as difficult if you take the time to figure out what you need to write. It's only confusing if you try and jump into the code head-on.
A pseudo-code example: Code:
FOR a = 1 to 36
FOR b = 1 to 36
FOR c = 1 to 36
PRINT a b c
END FOR
END FOR
END FOR
__________________
Daryl's Homepage | My Blogroll | My Profile | Firefox supporter! DevArticles Forum Moderator "The net is a waste of time, and that's exactly what's right about it." -- William Gibson |
![]() |
| Viewing: Dev Articles Community Forums > Programming > Java Development > Confusing but Simple Program Request? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|