Skip to content

Instantly share code, notes, and snippets.

@vaughan0
Forked from anonymous/gist:4202342
Created December 4, 2012 10:18
Show Gist options
  • Save vaughan0/4202445 to your computer and use it in GitHub Desktop.
Save vaughan0/4202445 to your computer and use it in GitHub Desktop.
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author calbrecht
*/
public class blockCounter {
private int[][] solidGameField;
private int sumHeightCounter;
private void heightCounter()
{
sumHeightCounter = 0;
for (int i=0; i<solidGameField.length; i++)
{
for (int j=0; j<solidGameField[0].length; j++)
{
if (solidGameField[i][j] != 0 )
{
//sumHeightCounter += solidGameField[j].length;
sumHeightCounter += i; // or j, depends on which one you choose to be the y coordinate
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment