*polished sample code.

This commit is contained in:
paladin-t 2016-01-29 20:04:32 +08:00
parent 6ff4cddbba
commit 5521ab62fc
3 changed files with 6 additions and 6 deletions

View File

@ -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$ + "!"

View File

@ -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

View File

@ -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