Advertisement
Guest User

Untitled

a guest
Feb 26th, 2017
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.89 KB | None | 0 0
  1. import java.util.Random;
  2.  
  3. /**
  4. * Contains constants used by GameOfLife.
  5. *
  6. * Constants that are defined here must be used by name because we may
  7. * change these values to ensure that your program works with any
  8. * values.
  9. *
  10. *
  11. */
  12. public class Config {
  13.  
  14. /**
  15. * The number of rows and columns of cells in the world.
  16. *
  17. * For full credit, use these named constants to create the world array
  18. * in GameOfLife.java rather than integer values such as 8 and 10.
  19. * A programmer should be able to change the number of rows and columns
  20. * in this file and, without any other changes, the world size should
  21. * change and the program should work correctly.
  22. *
  23. * For testing, we may set WORLD_ROWS and WORLD_COLUMNS to any value
  24. * between and including, 5 and 80.
  25. */
  26. public static final int WORLD_ROWS = 8;
  27. public static final int WORLD_COLUMNS = 10;
  28.  
  29. /**
  30. * The character displayed in the world if that cell is alive.
  31. */
  32. public static final char ALIVE = '@';
  33.  
  34. /**
  35. * The character displayed in the world if that cell is dead.
  36. */
  37. public static final char DEAD = '.';
  38.  
  39. /** Used to seed the java.util.Random object for generating
  40. * random numbers used by the initializeRandomWorld method.
  41. * By seeding the Random generator, we can predict
  42. * the "pseudo-random" values that will be generated.
  43. * This predictability aids in program development
  44. * and allows for automated grading.
  45. */
  46. public static final int SEED = 428;
  47.  
  48. /** CHANCE_ALIVE is used in the initializeRandomWorld method to
  49. * initialize the cells that are alive in the initial generation.
  50. * For example a value of 0.25 means about 25% of the cells should
  51. * be alive.
  52. */
  53. public static final double CHANCE_ALIVE = 0.25;
  54.  
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement