*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.
|
' Copyright (c) 2011 - 2016 Wang Renxin. All rights reserved.
|
||||||
' For more information, see https://github.com/paladin-t/my_basic/
|
' For more information, see https://github.com/paladin-t/my_basic/
|
||||||
|
|
||||||
s$ = "hello "
|
s$ = "Hello"
|
||||||
s$ = s$ + "world"
|
s$ = s$ + " " + "world"
|
||||||
print s$ + "!"
|
print s$ + "!"
|
||||||
|
@ -4,19 +4,19 @@
|
|||||||
|
|
||||||
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 "woof" + a;
|
print "Woof" + a;
|
||||||
enddef
|
enddef
|
||||||
endclass
|
endclass
|
||||||
|
|
||||||
|
@ -91,7 +91,7 @@ def brainfuck(cmd)
|
|||||||
enddef
|
enddef
|
||||||
|
|
||||||
' This is a brainfuck interpreter written with MY-BASIC
|
' This is a brainfuck interpreter written with MY-BASIC
|
||||||
print "BF: "
|
print "Input: "
|
||||||
input cmd$
|
input cmd$
|
||||||
' Use a sample code?
|
' Use a sample code?
|
||||||
if cmd$ = "hello" then
|
if cmd$ = "hello" then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user