Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.ArrayList;
- import java.util.Scanner;
- import java.io.File;
- public class Proj1401{
- public static void main(String[] args) throws Exception{
- File file = new File("Proj1.dat");
- Scanner scan = new Scanner(file);
- public static ArrayList<Life> list = new ArrayList<Life>();
- String cord = "";
- for(int i = 0; scan.hasNext(); i++){
- list.add(new Life(scan.nextInt(),scan.nextInt()));
- Scanner scan2 = new Scanner(cord);
- }
- for(int i = 0; i<list.size(); i++){
- System.out.println(list.get(i));
- }
- }
- public static Life up(Life temp){
- return new Life(temp.xcord,temp.ycord+1);
- }
- public static Life down(Life temp){
- return new Life(temp.xcord,temp.ycord-1);
- }
- public static Life left(Life temp){
- return new Life(temp.xcord-1,temp.ycord);
- }
- public static Life right(Life temp){
- return new Life(temp.xcord+1,temp.ycord);
- }
- public static Life upRight(Life temp){
- return new Life(temp.xcord+1,temp.ycord+1);
- }
- public static Life upLeft(Life temp){
- return new Life(temp.xcord-1,temp.ycord+1);
- }
- public static Life downLeft(Life temp){
- return new Life(temp.xcord-1,temp.ycord-1);
- }
- public static Life downRight(Life temp){
- return new Life(temp.xcord+1,temp.ycord-1);
- }
- public static boolean cellAlive(Life temp) {
- return if(temp.x)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement