Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Author
Message
Regnuar
17
Years of Service
User Offline
Joined: 25th Dec 2008
Location:
Posted: 15th Dec 2012 11:06 Edited at: 15th Dec 2012 11:07
Hello all,

I faced my winner in logic thinking (or maybe i'm just tired), but for some reason i can't solve a stupid mistace i'v made in my "cube from cubes" -project.

So, i'm trying to build a box from cubes X*Y*Z and change the row values with if statement and the problem presist like this;

XX
XXX
XXX
X

when it should be like;

XXX
XXX
XXX

oh hell, look for your self and help the stupid out

Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 15th Dec 2012 12:24
If you study your code carefully you'll see the error yourself.

You can try three things:

1. try a simple case first, e.g. use 2 rather than 10 and carefully work through the results of your code line by line (only 8 cubes!)

2. ask yourself whether the values of w, d and h are handled consistently

3. code it in a more intuitive way using three simple for loops like this

Regnuar
17
Years of Service
User Offline
Joined: 25th Dec 2008
Location:
Posted: 15th Dec 2012 12:40
Thanks Green Gandalf you saved my day!

Got it working easily using for loops, the cube is now finished and i may rest in peace.

the cubes are almost like a single cube when using

instead of


Except a lot heavier than a single cube

Thanks, Regnuar

Login to post a reply

Server time is: 2026-07-07 09:05:20
Your offset time is: 2026-07-07 09:05:20