Advertisement
Guest User

Untitled

a guest
Jul 20th, 2017
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 KB | None | 0 0
  1. import java.util.ArrayList;
  2. import java.util.Scanner;
  3. import java.io.File;
  4.  
  5. public class Proj1401{
  6. public static void main(String[] args) throws Exception{
  7. File file = new File("Proj1.dat");
  8. Scanner scan = new Scanner(file);
  9. public static ArrayList<Life> list = new ArrayList<Life>();
  10.  
  11. String cord = "";
  12. for(int i = 0; scan.hasNext(); i++){
  13. list.add(new Life(scan.nextInt(),scan.nextInt()));
  14. Scanner scan2 = new Scanner(cord);
  15. }
  16.  
  17.  
  18. for(int i = 0; i<list.size(); i++){
  19. System.out.println(list.get(i));
  20. }
  21. }
  22.  
  23. public static Life up(Life temp){
  24. return new Life(temp.xcord,temp.ycord+1);
  25. }
  26.  
  27. public static Life down(Life temp){
  28. return new Life(temp.xcord,temp.ycord-1);
  29. }
  30.  
  31. public static Life left(Life temp){
  32. return new Life(temp.xcord-1,temp.ycord);
  33. }
  34. public static Life right(Life temp){
  35. return new Life(temp.xcord+1,temp.ycord);
  36. }
  37.  
  38. public static Life upRight(Life temp){
  39. return new Life(temp.xcord+1,temp.ycord+1);
  40. }
  41.  
  42. public static Life upLeft(Life temp){
  43. return new Life(temp.xcord-1,temp.ycord+1);
  44. }
  45.  
  46. public static Life downLeft(Life temp){
  47. return new Life(temp.xcord-1,temp.ycord-1);
  48. }
  49.  
  50. public static Life downRight(Life temp){
  51. return new Life(temp.xcord+1,temp.ycord-1);
  52. }
  53. public static boolean cellAlive(Life temp) {
  54. return if(temp.x)
  55. }
  56.  
  57.  
  58. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement