announcements‎ > ‎

2015-11-25

posted Nov 25, 2015, 9:27 AM by Samuel Konstantinovich   [ updated Nov 25, 2015, 10:09 AM ]
Use a Random object to re-create your random number sequence and reproduce errors / issues.
import java.util.*;
public class rerandom{
    public static void main(String[]args){
	int seed = (int)(Math.random()*100000);
	//seed = 17127;
        //change this to any seed you want.
	System.out.println("If there is an error use this seed: "+seed);
	Random randgen = new Random(seed);

	for(int i=0;i<10;i++){
	    System.out.println(randgen.nextInt());
	}
    }
}

Write the methods:
public boolean addWordVertically(String word, int row, int col)
//top to bottom

public boolean addWordDiagonally(String word, int row, int col)
//bottom left, to top right (positive slope words)

Comments