begin comment pentomino, 130968; integer score, nummer, lengte, breedte, aantal stenen, aantal standen, i, j, k, teller, lb; lengte ≔ read; breedte ≔ read; aantal stenen ≔ read; aantal standen ≔ read; lb ≔ lengte × (breedte - 1); begin integer array bord [-39 : 100], standen, wijzer [1 : aantal stenen], informatie [1 : 8 × aantal standen]; boolean array ongebruikt [1 : aantal stenen]; procedure output; begin integer i, j; score ≔ score + 1; SPACE (1); for j ≔ 1 step 1 until 2 × lengte do begin PRINTTEXT (“-”); SPACE (1) end ; comment ABSFIXT (6, 2, time); NLCR; for i ≔ 0 step lengte until lb do begin PRINTTEXT(“I”); for j ≔ 1 step 1 until lengte - 1 do begin SPACE (3); if bord [i + j] ≠ bord [i + j + 1] then PRINTTEXT(“I”) else SPACE (1) end ; SPACE (3); PRINTTEXT(“I”); NLCR; SPACE (1); if i < lb then begin for j ≔ 1 step 1 until lengte do begin if bord [i + j] ≠ bord [i + j + lengte] then begin PRINTTEXT (“-”); SPACE (1); PRINTTEXT (“-”); SPACE (1) end else SPACE (4) end end else for j ≔ 1 step 1 until 2 × lengte do begin PRINTTEXT (“-”); SPACE (1) end ; NLCR end ; NLCR; NLCR; if score = 7 then goto ex end output; procedure up (veld, kolom); value veld, kolom; integer veld, kolom; begin integer i, j, k, r, w, steen, aantal; nummer ≔ nummer + 1; for steen ≔ 1 step 1 until aantal stenen do if ongebruikt [steen] then begin ongebruikt [steen] ≔ false ; bord [veld] ≔ steen; aantal ≔ standen [steen] - 1; for i ≔ 0 step 1 until aantal do begin w ≔ wijzer [steen] + 4 × i; if bord [informatie [w] + veld] = 0 then begin if bord [informatie [w + 1] + veld] = 0 then begin if bord [informatie [w + 2] + veld] = 0 then begin if bord [informatie [w + 3] + veld] = 0 then begin for j ≔ 0, 1, 2, 3 do bord [informatie [w + j] + veld] ≔ steen; if nummer = aantal stenen then output else begin for k ≔ kolom step 1 until lengte do for r ≔ 0 step lengte until lb do if bord [r + k] = 0 then goto beet; beet: up (r + k, k) end ; for j ≔ 0, 1, 2, 3 do bord [informatie [w + j] + veld] ≔ 0 end end end end end ; ongebruikt [steen] ≔ true end ; bord [veld] ≔ 0; down: nummer ≔ nummer - 1 end up; teller ≔ 1; for i ≔ 1 step 1 until aantal stenen do begin j ≔ read; comment steennummer, wordt niet gebruikt; wijzer [i] ≔ teller; standen [i] ≔ read; for j ≔ 1 step 1 until standen [i] do begin for k ≔ 0 step 1 until 3 do informatie [teller + k] ≔ read; teller ≔ teller + 4 end end ; for i ≔ - 39 step 1 until 0, 61 step 1 until 100 do bord [i] ≔ - 1; for i ≔ 1 step 1 until 60 do bord [i] ≔ 0; for i ≔ 1 step 1 until aantal stenen do ongebruikt [i] ≔ true ; score ≔ nummer ≔ 0; NLCR; PRINTTEXT (“The first 7 solutions:”); NLCR; NLCR; NLCR; up (1, 1); ex: end end