| Author |
Query on 4b (Say) "unrolling loops" nitpick
|
Rian Nolan
Greenhorn
Joined: Jun 21, 2006
Posts: 9
|
|
I'm a bit befuddled in 4b(Say) at the moment.
I have it "working" in the broadest possible sense, but I'm obviously overcomplicating matters somewhat, as one of the nitpicks was:
You are putting a whole lot of effort into setting things up so you can use a loop... 3 times. 4 at the most.
I'd like you to "unroll" the loop, hard code each instance, and we'll take it from there.
...and I'm not not quite sure how to "unroll" a loop (or loops)
Should I go from this:
to (something like) this:
Any advice on unrolling loops?
Should I stop rolling my own?
Cheers,
Brian.
|
 |
Janeice DelVecchio
Saloon Keeper
Joined: Sep 14, 2009
Posts: 1612
|
|
I just want to say that I don't know the answer... and I hate Say b.
And.... if you're not looping, then why the heck does 'i' make a difference anyways... can't you just do the stuff without looping it?
|
When you do things right, people won't be sure you've done anything at all.
|
 |
Katrina Owen
Sheriff
Joined: Nov 03, 2006
Posts: 1334
|
|
What Janeice said (no, not the censored bit!)
you don't need i, just do something like this.
If you get stuck, ping your nitpicker for hints, or ask obliquely here on the forum!
|
 |
Gary Ba
Ranch Hand
Joined: Oct 23, 2009
Posts: 150
|
|
random reply to your quesetion...
I too had a difficulty with Say b so your not the only one.
Garry
|
star chaser..
|
 |
Rian Nolan
Greenhorn
Joined: Jun 21, 2006
Posts: 9
|
|
Found these threads which managed to cover off all of my concerns about unrolling loops and not using ternary operators:
Nice to know that I'm not completely off the beaten track!
Math, Ternaries, Passing and Returning
Say 4b - completely stumped
...so attempt#2 with ifs everywhere, and nested loops unrolled is on its way...
|
 |
Katrina Owen
Sheriff
Joined: Nov 03, 2006
Posts: 1334
|
|
|
Rian, I promise it's worth it. I know it feels just awful to hard code it like that... but there are efficiencies and beautiful things on the other side that you just cannot get to while you have that loop in place. Promise.
|
 |
 |
|
|
subject: Query on 4b (Say) "unrolling loops" nitpick
|
|
|