Skip to content

Instantly share code, notes, and snippets.

View frojasg's full-sized avatar

Francisco Rojas frojasg

  • San Francisco, California
View GitHub Profile
@frojasg
frojasg / Matrix.java
Created January 10, 2011 12:04
zig-zag
public class Matrix {
public static void main(String [] args){
int n = Integer.parseInt(args[0]);
int[][] A = new int[n][n];
int count = 0;
for(int i = 0; i< n; i++) {
for(int j = i, z=0; j>=0 && z <= i; j--, z++){
if(i%2==1) {
A[z][j]=count;