day8_common.carbon 611 B

1234567891011121314151617181920212223242526
  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 Core library "range";
  8. import library "io_utils";
  9. class Grid {
  10. fn Read() -> Grid {
  11. returned var me: Grid;
  12. for (y: i32 in Core.Range(50)) {
  13. for (x: i32 in Core.Range(50)) {
  14. me.data[x][y] = ReadChar();
  15. }
  16. SkipNewline();
  17. }
  18. return var;
  19. }
  20. var data: array(array(i32, 50), 50);
  21. }