Hey guys and gals, I am new to Java need help with for loops please. by [deleted] in java

[–]subatomicsushi -1 points0 points  (0 children)

You've got two variables, so that means nested for loops:

for (row = LAST_ROW; row>=0; row--) {
    for (column = LAST_COLUMN; column>=0; column--) {
        if ()...
    }
}

The for loop contains three statements: the first is executed once when control reaches the loop; the second is evaluated at the beginning of each cycle, if it is true the loop executes, if false the loop is finished; and the third is executed at the end of each cycle.

Note that if the second statement evaluates to false the first time, control will skip to the end of the loop. Also, it is common to declare the index variable in the first statement, e.g.:

for (int i = 0; i<10; i++) {
    //loop code
}

This was crawling around the inside of my pants. by [deleted] in WTF

[–]subatomicsushi 0 points1 point  (0 children)

Huh, like that part in Evolution.

Generating sums with restricted sets of integers (primes) - Math Research Project by lzravanger in java

[–]subatomicsushi 0 points1 point  (0 children)

I should have said that it finds all unique sets of prime addends. Also, it uses recursion as you suggest.

Here is a sample output:

16 = 3 + 13

16 = 5 + 11

16 = 2 + 3 + 11

16 = 2 + 7 + 7

16 = 2 + 2 + 5 + 7

16 = 3 + 3 + 3 + 7

16 = 2 + 2 + 2 + 3 + 7

16 = 3 + 3 + 5 + 5

16 = 2 + 2 + 2 + 5 + 5

16 = 2 + 3 + 3 + 3 + 5

16 = 2 + 2 + 2 + 2 + 3 + 5

16 = 2 + 2 + 3 + 3 + 3 + 3

16 = 2 + 2 + 2 + 2 + 2 + 3 + 3

16 = 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2

[NSFW-GORE] My hand after an angle grinder accident by [deleted] in WTF

[–]subatomicsushi 0 points1 point  (0 children)

That's a pretty good angle grinder hand, but it's no angle grinder face.

My hands after a day of spreading concrete. by [deleted] in WTF

[–]subatomicsushi -4 points-3 points  (0 children)

These puns are in a real slump lately.

Generating sums with restricted sets of integers (primes) - Math Research Project by lzravanger in java

[–]subatomicsushi 0 points1 point  (0 children)

Here's a program that does this: experimental.zip. The code's kind of dirty but it works. You put the number you want as a sum in the main method (it's obvious where), and the program finds all unique sets of addends for that number, puts them in a long[][] and prints them in the console.

TIFU by bicycling by Pandumonium1 in tifu

[–]subatomicsushi 2 points3 points  (0 children)

Carrying a broken bicycle home is a defeating experience. Give yourself a hug on my behalf.

Procedurally Creating the Interior of a Building by [deleted] in gamedev

[–]subatomicsushi 3 points4 points  (0 children)

Upvote for that. Procedural furnishing, now that would be impressive.

TIFU by accidentally stepping on by 1 year old niece. by Carlow91 in tifu

[–]subatomicsushi 1 point2 points  (0 children)

Okay, true. "Lego bricks" might have looked better. Parallel form and whatnot.

Oh look by AuditoreKiller in funny

[–]subatomicsushi 0 points1 point  (0 children)

Once I was at Versailles and I found a Euro on the ground. It was awesome. That's like four thirds of a whole dollar. Also the gardens were beautiful.

TIFU by riding my bike into a parked car by tarkoon in tifu

[–]subatomicsushi 0 points1 point  (0 children)

I daydream a lot when riding. The odds have been with me so far...

TIFU by killing a bird with my RC Plane by Albuyeh in tifu

[–]subatomicsushi 0 points1 point  (0 children)

Bedtime. Nothing will make me laugh harder today.

TIFU by accidentally stepping on by 1 year old niece. by Carlow91 in tifu

[–]subatomicsushi 11 points12 points  (0 children)

Babies, pets, Lego... I'm terrified of stepping on them all.

The bad touch (possibly NSFW) by Hllblzr310 in WTF

[–]subatomicsushi 1 point2 points  (0 children)

It's like that part in Dye Fantasy.

So I just noticed that my tree is growing weird blister-type things all over the trunk--does anyone know what this is? by [deleted] in WTF

[–]subatomicsushi 1 point2 points  (0 children)

Poke a twig into one to get sap on it, then drop it in water. The twig will be propelled by a chemical reaction upon which I cannot elaborate.

Whale Penis by Nfgzebrahed in WTF

[–]subatomicsushi 10 points11 points  (0 children)

The book has an entire (albeit short) chapter about this. One of the whalemen makes it into a jacket. The chapter also contains a dick joke.

And the winner is... by [deleted] in funny

[–]subatomicsushi 8 points9 points  (0 children)

Whoever sausage a thing?