begin; comment pentomino, 130968 ; integer SCORE, NUMMER, LENGTE, BREEDTE, AANTALSTENEN, AANTALSTANDEN, I, J, K, TELLER, LB; LENGTE := READ; BREEDTE := READ; AANTALSTENEN := READ; AANTALSTANDEN := READ; LB := LENGTE(BREEDTE - 1); begin; integer array BORD[-39 : 100], STANDEN, WIJZER[1 : AANTALSTENEN], INFORMATIE[1 : 8
AANTALSTANDEN]; Boolean array ONGEBRUIKT[1 : AANTALSTENEN]; 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 AANTALSTENEN 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 = AANTALSTENEN 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 AANTALSTENEN 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 AANTALSTENEN do ONGEBRUIKT[I] := true; SCORE := NUMMER := 0; NLCR; PRINTTEXT("The first 7 solutions:"); NLCR; NLCR; NLCR; UP(1, 1); EX: ; end ; end;