fork download
  1. import std.stdio;
  2.  
  3. void main()
  4. {
  5. uint[] u1 =
  6. [
  7. 0, 1, 2, 3,
  8. 4, 5, 6, 7,
  9. 8, 9,10,11,
  10. 12,13,14,15,
  11.  
  12. 16,17,18,19,
  13. 20,21,22,23,
  14. 24,25,26,27,
  15. 28,29,30,31,
  16. ];
  17.  
  18. uint[16][2] u2 =
  19. [
  20. 0, 1, 2, 3,
  21. 4, 5, 6, 7,
  22. 8, 9,10,11,
  23. 12,13,14,15,
  24.  
  25. 16,17,18,19,
  26. 20,21,22,23,
  27. 24,25,26,27,
  28. 28,29,30,31,
  29. ];
  30.  
  31. for (uint y; y < 8; ++y)
  32. {
  33. for (uint x; x < 4; ++x)
  34. {
  35. writef("%2d ", u1[y * 4 + x]);
  36. }
  37. }
  38. writeln("");
  39.  
  40. for (uint y; y < 2; ++y)
  41. {
  42. for (uint x; x < 16; ++x)
  43. {
  44. writef("%2d ", u2[y][x]);
  45. }
  46. }
  47. }
Success #stdin #stdout 0.02s 2120KB
stdin
Standard input is empty
stdout
 0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 
 0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31