From bec53bad122d8a5dec9c0b6bcba35f31510755f4 Mon Sep 17 00:00:00 2001 From: MatMasIt Date: Tue, 28 Sep 2021 22:57:03 +0200 Subject: [PATCH] Added comments to rectangle prorgam --- examples/rect.mga | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/examples/rect.mga b/examples/rect.mga index f72ea05..2e20a3f 100644 --- a/examples/rect.mga +++ b/examples/rect.mga @@ -1,19 +1,38 @@ OUT I will draw a rectangle\n +#show welcome message INT w +#initialize width INT h -IN INT w l +#initialize height +IN INT w l +#input height as an int IN INT h h +#input width as an int INT wr +#initialize width counter INT hr +#initialize height counter SET wr 0 +#set width counter to 0 SET hr 0 +# set height counter to 0 :wrc +#row label :wf +#column label OUT * +#put char INC wr +#increment width counter JL wf wr w +#loop until desired width OUT \n +#put newline char SET wr 0 +# set width counter to 0 INC hr +#increment height counter JL wrc hr h +#loop until desired height END +#quit