*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$ = s$ + "world"
|
||||
print s$ + "!"
|
||||
print s$ + "!"
|
||||
|
@ -14,4 +14,4 @@ for n = 3 to e
|
||||
if isp = 0 then exit
|
||||
wend
|
||||
if isp = 1 then print n, ", "
|
||||
next n
|
||||
next n
|
||||
|
@ -19,4 +19,4 @@ for y = 5 to x step 2
|
||||
next
|
||||
a = a * 4
|
||||
|
||||
print "Pi = ", a
|
||||
print "Pi = ", a
|
||||
|
@ -20,4 +20,4 @@ show:
|
||||
for i = 0 to n - 1
|
||||
print arr(i), ", "
|
||||
next
|
||||
return
|
||||
return
|
||||
|
@ -12,4 +12,4 @@ enddef
|
||||
|
||||
a = 3
|
||||
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/
|
||||
|
||||
class animal
|
||||
def speak(a)
|
||||
print "default" + a;
|
||||
enddef
|
||||
def speak(a)
|
||||
print "default" + a;
|
||||
enddef
|
||||
endclass
|
||||
|
||||
class cat(animal)
|
||||
def speak(a)
|
||||
print "meow" + a;
|
||||
enddef
|
||||
def speak(a)
|
||||
print "meow" + a;
|
||||
enddef
|
||||
endclass
|
||||
|
||||
class dog(animal)
|
||||
def speak(a)
|
||||
print "bark" + a;
|
||||
enddef
|
||||
def speak(a)
|
||||
print "bark" + a;
|
||||
enddef
|
||||
endclass
|
||||
|
||||
c = new(cat)
|
||||
d = new(dog)
|
||||
|
||||
c.speak("!")
|
||||
d.speak("!")
|
||||
d.speak("!")
|
||||
|
Loading…
x
Reference in New Issue
Block a user