*polished sample code.
This commit is contained in:
parent
6ff4cddbba
commit
5521ab62fc
@ -2,6 +2,6 @@
|
||||
' Copyright (c) 2011 - 2016 Wang Renxin. All rights reserved.
|
||||
' For more information, see https://github.com/paladin-t/my_basic/
|
||||
|
||||
s$ = "hello "
|
||||
s$ = s$ + "world"
|
||||
s$ = "Hello"
|
||||
s$ = s$ + " " + "world"
|
||||
print s$ + "!"
|
||||
|
@ -4,19 +4,19 @@
|
||||
|
||||
class animal
|
||||
def speak(a)
|
||||
print "default" + a;
|
||||
print "Default" + a;
|
||||
enddef
|
||||
endclass
|
||||
|
||||
class cat(animal)
|
||||
def speak(a)
|
||||
print "meow" + a;
|
||||
print "Meow" + a;
|
||||
enddef
|
||||
endclass
|
||||
|
||||
class dog(animal)
|
||||
def speak(a)
|
||||
print "woof" + a;
|
||||
print "Woof" + a;
|
||||
enddef
|
||||
endclass
|
||||
|
||||
|
@ -91,7 +91,7 @@ def brainfuck(cmd)
|
||||
enddef
|
||||
|
||||
' This is a brainfuck interpreter written with MY-BASIC
|
||||
print "BF: "
|
||||
print "Input: "
|
||||
input cmd$
|
||||
' Use a sample code?
|
||||
if cmd$ = "hello" then
|
||||
|
Loading…
x
Reference in New Issue
Block a user