Aer Interpreter Source
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
563 B

  1. class Program {
  2. private string cycle(char $a, char $b, int $i = 0) {
  3. static bool[] $switches;
  4. if(array_key_exists($i, $switches))
  5. $switches[$i] = !$switches[$i];
  6. else
  7. !($switches[$i] = true);
  8. return ($switches[$i]) ? $a : $b;
  9. }
  10. public void main() {
  11. for(int $i = 1; $i < 3; $i++) {
  12. print($i + $this->cycle('a', 'b') + PHP_EOL);
  13. for(int $j = 1; $j < 5; $j++) {
  14. print(' ' + $j + $this->cycle('a', 'b', 1) + PHP_EOL);
  15. for(int $k = 1; $k < 3; $k++) {
  16. print(' ' + $k + $this->cycle('c', 'd', 2) + PHP_EOL);
  17. }
  18. }
  19. }
  20. }
  21. }