Hi Andryw,
Hi guys!
What is the best way to print tabels, like a minesweeper?
Example:
I have a array, like (1 2 3 4 5 6) and I want print like:
1 2 3
4 5 6
I know that the numebr of lines are 2 and the number of colunes are 3.
It`s easier concat and print a string or use Qtk GUI?
There are many ways to do this. Oz does also support traditional
for-loops as in imperative programming languages:
declare
%% Initialize
Ar = {Array.new 0 5 0}
in
for I in 0..5 do
Ar.I := I+1
end
%% Print
for Y in 0..1 do
for X in 0..2 do
{System.print Ar.(Y*3+X)}
end
{System.printInfo "\n"}
end
If you want to see how to implement a Minesweeper GUI with Qtk, here is
a good place to look: http://www.info.ucl.ac.be/~raph/minesweeper/
Cheers,
Wolfgang
_________________________________________________________________________________
mozart-users mailing list
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users