Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,18 @@
|
|||
#3 = 16 // size (height) of the triangle
|
||||
Buf_Switch(Buf_Free) // Open a new buffer for output
|
||||
Ins_Char(' ', COUNT, #3*2+2) // fill first line with spaces
|
||||
Ins_Newline
|
||||
Line(-1) Goto_Col(#3)
|
||||
Ins_Char('*', OVERWRITE) // the top of triangle
|
||||
for (#10=0; #10 < #3-1; #10++) {
|
||||
BOL Reg_Copy(9,1) Reg_Ins(9) // duplicate the line
|
||||
#20 = '*'
|
||||
for (#11 = #3-#10; #11 < #3+#10+1; #11++) {
|
||||
Goto_Col(#11-1)
|
||||
if (Cur_Char==Cur_Char(2)) { #21=' ' } else { #21='*' }
|
||||
Ins_Char(#20, OVERWRITE)
|
||||
#20 = #21
|
||||
}
|
||||
Ins_Char(#21, OVERWRITE)
|
||||
Ins_Char('*', OVERWRITE)
|
||||
}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
#1 = 1 // x
|
||||
#2 = 1 // y
|
||||
#3 = 16 // length (height of the triangle / 2)
|
||||
#4 = 5 // depth of recursion
|
||||
|
||||
Buf_Switch(Buf_Free) // Open a new buffer for output
|
||||
Ins_Newline(#3*2) // Create as many empty lines as needed
|
||||
Call("Triangle") // Draw the triangle
|
||||
BOF
|
||||
Return
|
||||
|
||||
:Triangle:
|
||||
if (#4 == 0) {
|
||||
Goto_Line(#2)
|
||||
EOL Ins_Char(' ', COUNT, #1-Cur_Col+1) // add spaces if needed
|
||||
Goto_Col(#1)
|
||||
Ins_Char('*', OVERWRITE)
|
||||
} else {
|
||||
Num_Push(1,4)
|
||||
#2 += #3; #3 /= 2; #4--; Call("Triangle")
|
||||
Num_Pop(1,4)
|
||||
Num_Push(1,4)
|
||||
#1 += #3; #3 /= 2; #4--; Call("Triangle")
|
||||
Num_Pop(1,4)
|
||||
Num_Push(1,4)
|
||||
#1 += 2*#3; #2 += #3; #3 /= 2; #4--; Call("Triangle")
|
||||
Num_Pop(1,4)
|
||||
}
|
||||
Return
|
||||
Loading…
Add table
Add a link
Reference in a new issue