Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
32
Task/Reverse-a-string/OxygenBasic/reverse-a-string-1.basic
Normal file
32
Task/Reverse-a-string/OxygenBasic/reverse-a-string-1.basic
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
'8 BIT CHARACTERS
|
||||
|
||||
string s="qwertyuiop"
|
||||
sys a,b,i,j,le=len s
|
||||
'
|
||||
for i=1 to le
|
||||
j=le-i+1
|
||||
if j<=i then exit for
|
||||
a=asc s,i
|
||||
b=asc s,j
|
||||
mid s,j,chr a
|
||||
mid s,i,chr b
|
||||
next
|
||||
'
|
||||
|
||||
print s
|
||||
|
||||
'16 BIT CHARACTERS
|
||||
|
||||
wstring s="qwertyuiop"
|
||||
sys a,b,i,j,le=len s
|
||||
'
|
||||
for i=1 to le
|
||||
j=le-i+1
|
||||
if j<=i then exit for
|
||||
a=unic s,i
|
||||
b=unic s,j
|
||||
mid s,j,wchr a
|
||||
mid s,i,wchr b
|
||||
next
|
||||
'
|
||||
print s
|
||||
19
Task/Reverse-a-string/OxygenBasic/reverse-a-string-2.basic
Normal file
19
Task/Reverse-a-string/OxygenBasic/reverse-a-string-2.basic
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
string s="qwertyuiop"
|
||||
sys p=strptr s, le=len s
|
||||
mov esi,p
|
||||
mov edi,esi
|
||||
add edi,le
|
||||
dec edi
|
||||
(
|
||||
cmp esi,edi
|
||||
jge exit
|
||||
mov al,[esi]
|
||||
mov ah,[edi]
|
||||
mov [esi],ah
|
||||
mov [edi],al
|
||||
inc esi
|
||||
dec edi
|
||||
repeat
|
||||
)
|
||||
|
||||
print s
|
||||
Loading…
Add table
Add a link
Reference in a new issue