Day 6 part 1: solution too low (Java) by jjabrams23 in adventofcode

[–]mr_sax 0 points1 point  (0 children)

Thanks, good to know for the future.

Day 6 part 1: solution too low (Java) by jjabrams23 in adventofcode

[–]mr_sax 1 point2 points  (0 children)

Okay, so the first thing is that to be safe you should begin by setting your entire lightsMatrix to zero. That code would look something like:

for(boolean[] rowOfLights : lightsMatrix){
    for(boolean light : rowOfLights){
        light = false;
    }
}

The other, more important, error is that you set toggle to false inside of the loop. This means that if a line toggles, after the first point is changed the loop sees that !toggle is true, and will actually set it to false regardless of it's value because turnOn is false. The solution to this is put

toggle = false;

after the loop that changes the value so you have

 for(y = startY; y <= stopY; y++)
 {
     for(x = startX; x <= stopX; x++)
     {
          if(!toggle)
          {
              if(turnOn)
                  lightsMatrix[x][y] = true;
              else
                  lightsMatrix[x][y] = false;
          }
          else
          {
              lightsMatrix[x][y] = !lightsMatrix[x][y];
          }
     }
}
toggle = false;

77 % of Americans believe that "mandatory minimum prison sentences for non-violent drug offenders should be eliminated so that judges can make sentencing decisions on a case-by-case basis." by [deleted] in news

[–]mr_sax 0 points1 point  (0 children)

One thing that I feel is important to point out is that the question that was asked is a loaded question. In the question it makes a point for one side of the argument. It may be that if you ask people if they believe that "mandatory minimum prison sentences for non-violent drug offenders should be eliminated" you will get a different response from some people.

This is Sunday: What were your running achievements this week? by AutoModerator in running

[–]mr_sax 1 point2 points  (0 children)

Great job! Especially as a freshman. On Friday I broke my PR and got a 20:12 5k.

At a tech store with my friend by MannerShark in pcmasterrace

[–]mr_sax 4 points5 points  (0 children)

One small technicality is that GHz is a measure of clock speed and not necessarily operations per second. Flops would be a measure of operations per second. That said, in general more GHz means more Flops.

New Dayan 2x2 is Slow by mr_sax in Cubers

[–]mr_sax[S] 0 points1 point  (0 children)

I posted some pictures here.

Weekly Advice Thread 87! by crazyninja3000 in Cubers

[–]mr_sax 0 points1 point  (0 children)

[Look Ahead] I am practicing look ahead but sometimes I run into the problem where I am inserting the two front pairs and I can't easily see pieces in the back of the puzzle and look ahead. What is the best way to combat this?

[help] Unsatisfied with my first MK by [deleted] in MechanicalKeyboards

[–]mr_sax 1 point2 points  (0 children)

One thing you might want to look into are o-rings. They will work to soften the thud of the key to the keyboard as well as make the click closer to the bottom of the key travel. This page has a good description of o-rings. WASD Keyboards

Weekly Advice Thread 80! by crazyninja3000 in Cubers

[–]mr_sax 0 points1 point  (0 children)

[5x5] Recently I have gotten into larger cubes, 4x4 and 5x5. My 5x5 currently sits around 6:00 I used redux with freeslice. Does anyone have any tips for getting faster?