*polished indent and new line format of sample code.
This commit is contained in:
parent
93d663365f
commit
eeff6d28d2
@ -4,4 +4,4 @@
|
|||||||
|
|
||||||
s$ = "hello "
|
s$ = "hello "
|
||||||
s$ = s$ + "world"
|
s$ = s$ + "world"
|
||||||
print s$ + "!"
|
print s$ + "!"
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
@ -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);
|
||||||
|
@ -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("!")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user