day8_common.carbon 606 B

1234567891011121314151617181920212223242526272829
  1. // Part of the Carbon Language project, under the Apache License v2.0 with LLVM
  2. // Exceptions. See /LICENSE for license information.
  3. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. // https://adventofcode.com/2024/day/8
  5. library "day8_common";
  6. import Core library "io";
  7. import library "io_utils";
  8. class Grid {
  9. fn Read() -> Grid {
  10. returned var me: Grid;
  11. var y: i32 = 0;
  12. while (y < 50) {
  13. var x: i32 = 0;
  14. while (x < 50) {
  15. me.data[x][y] = ReadChar();
  16. ++x;
  17. }
  18. SkipNewline();
  19. ++y;
  20. }
  21. return var;
  22. }
  23. var data: [[i32; 50]; 50];
  24. }