*polished indent and new line format of sample code.

This commit is contained in:
paladin-t 2016-01-01 10:30:26 +08:00
parent 93d663365f
commit eeff6d28d2
6 changed files with 15 additions and 15 deletions

View File

@ -4,4 +4,4 @@
s$ = "hello " s$ = "hello "
s$ = s$ + "world" s$ = s$ + "world"
print s$ + "!" print s$ + "!"

View File

@ -14,4 +14,4 @@ for n = 3 to e
if isp = 0 then exit if isp = 0 then exit
wend wend
if isp = 1 then print n, ", " if isp = 1 then print n, ", "
next n next n

View File

@ -19,4 +19,4 @@ for y = 5 to x step 2
next next
a = a * 4 a = a * 4
print "Pi = ", a print "Pi = ", a

View File

@ -20,4 +20,4 @@ show:
for i = 0 to n - 1 for i = 0 to n - 1
print arr(i), ", " print arr(i), ", "
next next
return return

View File

@ -12,4 +12,4 @@ enddef
a = 3 a = 3
b = 4 b = 4
print a; b; area(a, b); print a; b; area(a, b);

View File

@ -3,25 +3,25 @@
' For more information, see https://github.com/paladin-t/my_basic/ ' For more information, see https://github.com/paladin-t/my_basic/
class animal class animal
def speak(a) def speak(a)
print "default" + a; print "default" + a;
enddef enddef
endclass endclass
class cat(animal) class cat(animal)
def speak(a) def speak(a)
print "meow" + a; print "meow" + a;
enddef enddef
endclass endclass
class dog(animal) class dog(animal)
def speak(a) def speak(a)
print "bark" + a; print "bark" + a;
enddef enddef
endclass endclass
c = new(cat) c = new(cat)
d = new(dog) d = new(dog)
c.speak("!") c.speak("!")
d.speak("!") d.speak("!")