Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var i, j, count, x, y, num_elem: integer;
- var f: array [0..11, 0..11] of integer; // Äîáàâèëè ðàìêó
- BEGIN
- randomize();
- num_elem := 10;
- for i := 0 to num_elem + 1 do // Äîáàâèëè ðàìêó
- for j := 0 to num_elem + 1 do // Äîáàâèëè ðàìêó
- f[i,j] := 0;
- count := 0;
- while (count < 10) do
- begin
- x := random(num_elem) + 1;
- y := random(num_elem) + 1;
- if f[x, y] + f[x - 1, y] + f[x + 1, y] + f[x, y - 1] + f[x, y + 1] = 0 then
- begin
- f[x, y] := 1;
- count := count + 1;
- end;
- end;
- END.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement