fork download
  1. using System;
  2.  
  3. namespace chess
  4. {
  5. class MainClass
  6. {
  7. public static void Main (string[] args)
  8. {
  9. Char[,] board = new Char[8,8];
  10. for (int i = 0; i < 7; i++) {
  11. Console.WriteLine (i);
  12. for (int j = 0; j < 7; i++) {
  13. if (i % 2 == 0 && j % 2 == 0) {
  14. board [i, j] = 'X';
  15. } else {
  16. board [i, j] = 'O';
  17. }
  18. }
  19. }
  20. for (int x = 0; x < 8; x++) {
  21. for (int k = 0; k < 8; k++) {
  22. Console.Write(board[x, k]);
  23. }
  24. Console.Write("\n");
  25. }
  26. }
  27. }
  28. }
  29.  
Runtime error #stdin #stdout #stderr 0.04s 26976KB
stdin
Standard input is empty
stdout
0
stderr
Unhandled Exception:
System.IndexOutOfRangeException: Array index is out of range.
  at chess.MainClass.Main (System.String[] args) [0x00000] in <filename unknown>:0 
[ERROR] FATAL UNHANDLED EXCEPTION: System.IndexOutOfRangeException: Array index is out of range.
  at chess.MainClass.Main (System.String[] args) [0x00000] in <filename unknown>:0