ICFP Contest 2006
Team: Abstraction Anonymous

yang_PUZZLES

Download

  1. Balance Certified Professional Program Puzzles
  2.  
  3. This file contains a list of puzzles. Solutions to these puzzles may count
  4. towards your BCPP certification. Use the certify program to submit
  5. your solutions. (Note: Not all maximum scores have been attained by the
  6. BCPP organization.)
  7.  
  8.  
  9. Puzzle: stop
  10. Initial memory: M[0-5] = [0, 1, 0, 0, 0, 0]
  11. Remainder of memory initialized from /etc/passwd
  12. Initial registers: {0, 1, 2, 3} {4, 5}
  13. Final memory: Any
  14. Final registers: Any
  15. Certification point value: 5 - 10
  16.  
  17. Puzzle: stop1
  18. Initial memory: M[0-5] = [0, 1, 0, 0, 0, 0].
  19. Remainder of memory initialized from /etc/passwd
  20. Initial registers: {0, 0, 0, 0} {0, 0}
  21. Final memory: Any
  22. Final registers: Any
  23. Certification point value: 5 - 10
  24.  
  25. Puzzle: stop127
  26. Initial memory: All zeroes except for M[127] = 127
  27. Initial registers: {0, 0, 0, 0} {0, 0}
  28. Final memory: Any
  29. Final registers: Any
  30. Certification point value: 5 - 20
  31.  
  32. Puzzle: stop128
  33. Initial memory: All zeroes except for M[128] = 128
  34. Initial registers: {0, 0, 0, 0} {0, 0}
  35. Final memory: Any
  36. Final registers: Any
  37. Certification point value: 5 - 15
  38.  
  39. Puzzle: copymem
  40. Initial memory: M[0] = a, where a <> 0. M[1] = 1.
  41. All other memory locations initialized to 0
  42. Initial registers: {0, 0, 0, 0} {0, 0}
  43. Final memory: Any
  44. Final registers: At least one register should contain a
  45. Certification point value: 60 - 200
  46.  
  47. Puzzle: copyreg
  48. Initial memory: M[0-7] = [1, 2, 4, 8, 16, 32, 64, 128].
  49. All other memory locations initialized to 0.
  50. Initial registers: {a, 0, 1, 2} {3, 4} where a <> 0
  51. Final memory: At least one memory location should contain a
  52. Final registers: Any
  53. Certification point value: 60 - 200
  54.  
  55. Puzzle: swapmem
  56. Initial memory: M[0-7] = [1, 2, 4, 8, 16, 32, 64, 128].
  57. All other memory locations initialized to 0.
  58. Initial registers: {0, 1, 2, 3} {4, 5}
  59. Final memory: There exist i and j such that 0 <= i < j <= 7 and
  60. M[i] contains the original value of M[j] and M[j]
  61. contains the original value of M[i]
  62. Final registers: Any
  63. Certification point value: 10 - 40
  64.  
  65. Puzzle: swapreg
  66. Initial memory: All memory locations initialized to 1
  67. Initial registers: {0, 1, 2, 3} {4, 5}
  68. Final memory: Any
  69. Final registers: Swap any two distinct registers. The value of the
  70. other registers may be anything
  71. Certification point value: 5 - 50
  72.  
  73. Puzzle: swapreg2
  74. Initial memory: All memory locations initialized to 1
  75. Initial registers: {a, b, c, d} {x, y} where a, b, c, d, x, y <> 0
  76. Final memory: Any
  77. Final registers: Swap any two distinct registers. The value of the
  78. other registers may be anything
  79. Certification point value: 10 - 50
  80.  
  81. Puzzle: addmem
  82. Initial memory: M[0] = a, M[1] = b, where a, b <> 0
  83. All other memory locations initialized to 0
  84. Initial registers: {0, 1, 2, 3} {4, 5}
  85. Final memory: M[2] = a + b
  86. Final registers: Any
  87. Certification point value: 5 - 40
  88.  
  89. Puzzle: addmem2
  90. Initial memory: M[0] = a, M[1] = b, where a, b <> 0
  91. All other memory locations initialized to 0
  92. Initial registers: {0, 1, 2, 3} {4, 5}
  93. Final memory: M[0] = a, M[1] = b, M[2] = a + b.
  94. All other memory locations must be 0
  95. Final registers: Any
  96. Certification point value: 10 - 50
  97.  
  98. Puzzle: multmem
  99. Initial memory: M[0] = a, M[1] = b, where a, b <> 0
  100. All other memory locations initialized to 0
  101. Initial registers: {0, 1, 2, 3} {4, 5}
  102. Final memory: M[2] = a * b
  103. Final registers: Any
  104. Certification point value: 60 - 200
  105.  
  106. Puzzle: fillmem
  107. Initial memory: M[0-2] = [a, i, j], where a <> 0, 8 <= i < j <= 255
  108. All other memory locations are initialized to 0
  109. Initial registers: {0, 1, 2, 3} {4, 5}
  110. Final memory: Memory locations from 8 to (i-1) must contain 0
  111. Memory locations from i to (j-1) must contain a
  112. Memory locations from j to 255 must contain 0
  113. (all ranges are inclusive)
  114. Final registers: Any
  115. Certification point value: 60 - 200
  116.  
  117. Puzzle: clearreg
  118. Initial memory: For each i from 0 to 255, M[i] = i
  119. Initial registers: {0, 1, 2, 3} {4, 5}
  120. Final memory: Any
  121. Final registers: All registers must be set to 0
  122. Certification point value: 20 - 100
  123.  

Hell is other programming languages. -- Sartran
Hell is that programming language! -- Dan
Ordinarily, one would enrich this language with more powerful means of computation. Instead I take a different tack... -- Harmonious Monk