Data update
This commit is contained in:
parent
72eb4943cb
commit
4d5544505c
2347 changed files with 62432 additions and 16731 deletions
8
Task/Loops-Foreach/Ballerina/loops-foreach.ballerina
Normal file
8
Task/Loops-Foreach/Ballerina/loops-foreach.ballerina
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
import ballerina/io;
|
||||
|
||||
public function main() {
|
||||
string[] birds = ["Swan", "Eagle", "Wren"];
|
||||
foreach string bird in birds {
|
||||
io:println(bird);
|
||||
}
|
||||
}
|
||||
44
Task/Loops-Foreach/Uxntal/loops-foreach.uxnatl
Normal file
44
Task/Loops-Foreach/Uxntal/loops-foreach.uxnatl
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
%newline { [ LIT2 0a -Console/write ] DEO }
|
||||
%space { [ LIT2 20 -Console/write ] DEO }
|
||||
|
||||
|18 @Console/write
|
||||
|
||||
|100
|
||||
|
||||
@on-reset ( -> )
|
||||
;array ;print-element foreach
|
||||
newline
|
||||
|
||||
;array ;double foreach
|
||||
|
||||
;array ;print-element foreach
|
||||
newline
|
||||
|
||||
BRK
|
||||
|
||||
@double ( addr* -- addr* )
|
||||
STH2k LDAk
|
||||
DUP ADD
|
||||
STH2r STA
|
||||
JMP2r
|
||||
|
||||
@print-element ( addr* -- addr* )
|
||||
LDAk print-byte space
|
||||
JMP2r
|
||||
|
||||
@print-byte ( byte -- )
|
||||
DUP #04 SFT /nibble
|
||||
&nibble ( byte -- )
|
||||
#0f AND DUP #09 GTH #27 MUL ADD [ LIT "0 ] ADD #18 DEO
|
||||
JMP2r
|
||||
|
||||
@foreach ( bytes* fn* -- bytes* )
|
||||
STH2
|
||||
LDA2k SWP2 INC2 INC2
|
||||
&l ( -- )
|
||||
STH2kr JSR2
|
||||
INC2 GTH2k ?&l
|
||||
POP2r POP2 POP2
|
||||
JMP2r
|
||||
|
||||
@array ={ 00 01 02 02 04 }
|
||||
Loading…
Add table
Add a link
Reference in a new issue