Free Science Fiction Stories

Free stories from the depths of my imagination

Wee Basic and Neo Spring Comp 2008

Forgot to mention that I’m pleased (but not insanely outrageously excitedly enthusiastically ready to pop a  multitude of corks) that Wee Basic came in the top 10 winners of the Neo Spring Competition.

See: http://www.neoflash.com/forum/index.php?topic=5080.0

Thank you to Dr Neo et al.  I’m assuming that Dr Neo is not a medical practitioner and likely not the holder of a phd.  I think he’s a doctor of competitions.

Actually, this is all a bit meh.  I think I’ll go back to my hovel which is a metaphor for the rock I live under, which is a metaphor for the simile that my life is like eternal confinement  (I’d take the red pill any day).

By the way, I’m sick of using the comments for arguments between my many different personalities so if someone wants to leave a comment, don’t feel shy!  Well, back to my medication….

May 16, 2008 Posted by freescifistories | Nintendo DS | | 2 Comments

Wee Tic Tac Toe Demo

I’ve written a tic tac toe demo for Wee Basic in order to demonstrate use of about 95% of the language. The main things it leaves out are sprites and backgrounds which were demonstrated on the release of Wee 0.4.

Tic tac toe is based on a program written by Tim Hartnell in his Giant Book of Computer Programs in the 1980’s, modified for Wee Basic using a great tool called BAS2SB which converts line numbers into standard BASIC. I recommend both Tim Hartnell’s books and BAS2SB.

This blog does not allow me to upload txt files (ver frustrating!) so I’ve put a ppt extension on the file. To use it, just change the ppt extension to txt. Download here:tictactoe.ppt

Here’s a screenshot (not that pretty but I’m sure someone will improve it):

tictactoe.jpg

If you are getting “statement expected” error at the end of this program or the sprite demo, see my post in this topic:

http://www.neoflash.com/forum/index.php/topic,5039.0.html

March 22, 2008 Posted by freescifistories | Nintendo DS | | No Comments

Wee Basic - Now with Sprites and Backgrounds

Yes, you heard it. Wee Basic now allows the use of sprites and backgrounds so you can try your hand with real Nintendo DS games using simple BASIC.

running.jpg

weeneo.jpg

I’ve even entered Wee Basic for the first time in the NeoFlash summer coding competition: http://www.neoflash.com/forum/index.php/topic,4951.0.html

Version 0.4

Download: wee04.ppt

To use the demo program,put Wee and all of the gif files and demo.txt into the root directory of your card.
Then load the demo in Wee Basic, press A or start to run and enjoy!
Don’t forget to DLDI patch Wee for your card.

Fixed:

- bugs with nested ifs

added/changed

- neo splash screen
- sprites on both screens (must be gif files)
- backgrounds on both screens (must be gif files)
- can uses start or A to start a program running
- new commands:

loadspr number,screen,x,y,,width,height,file name (creates a sprite specified by the file name on the screen specified at the specified coordinates)
movspr number, screen, x,y (moves an existing sprite specified by the number to new coordinates x and Y on the screen)
delspr number, screen (deletes the specified sprite)
backgr screen, file name (creates a background on the specified screen with the gif file specified by the file name)

Notes:

- file names must be valid gif files and you must specify the full file name
- gif files must be kept in the root directory of your card
- don’t try to move or delete sprites that you haven’t created
- each screen has its own numbered sprites, so you can specify the number 1 for a sprite on the top and bottom screens but don’t specify the same number for sprites on the same screen

(Look at the demo program for examples)

As always, when you download the file, change the extension from PPT to ZIP.

Edit: As Goomek pointed out in the comments, I forgot the demo program.  Here it is (just copy and paste into a text file):

let soldier=1
let bottom=0
let top=1
let keya=202
let keyb=203
let right=205
let left=204
let soldx=5
let soldy=95

cls 1
keyhide
cls 0

gosub topback:
gosub botback:
gosub soldspr:

lab start:

let k=0
let k=key()

if k=keyb
gosub jump:
endif

if k=keya
goto finish:
endif
if k=right or k=left
gosub movsold:
endif

goto start:

lab finish:
end

sub key:
let k=0
while k=0
let k=key()
wend
return

sub topback:
backgr top,”island.gif”
return

sub botback:
backgr bottom,”lake.gif”
return

sub soldspr:
createspr soldier,bottom,
soldx,soldy,32,64,
“soldier.gif”
return

sub movsold:
if k=right
let soldx=soldx+20
movspr soldier,bottom,
soldx,soldy
endif
if k=left
let soldx=soldx-20
movspr soldier,bottom,
soldx,soldy
endif
return

sub jump:
for i=1 to 4
let soldy=soldy-20
movspr soldier,bottom,
soldx,soldy
gosub delay:
next
for i=1 to 4
let soldy=soldy+20
movspr soldier,bottom,
soldx,soldy
gosub delay:
next
return

sub delay:
for j=1 to 10
next
return

March 19, 2008 Posted by freescifistories | Nintendo DS | | 3 Comments

Wee Windows - Now you can program for the DS on Windows

The official poll winners are those who asked for Wee Basic on windows. Now you know the power of the poll!

Wee Windows: Windows version of Wee Basic

Instructions

1. Key mapping

D-Pad: use PC arrow keys

A, B, X and Y: PC keys F1, F2, F3 and F4

Keyboard: Use PC Keyboard

(Do not use the on-screen keyboard in the emulator as it is only there to show if the keyboard is hidden or not on the real DS. Other than that it does NOTHING).

2. Mostly self explanatory. Use ‘run’ in menu to run your basic program ( a DS emulator will suddenly appear!)

3. To install: change ppt to zip. The unzip all files into a single folder of your choice.

4. Known issues

-pressing F12 crashes when using key()
- stylus coordinates cannot be used - they don’t scale to the DS
- only capital appear when using the input function
- residual keypress on run

Be gentle with me. It’s only a first release :)

Download here:release-01.ppt

As usual change ppt to zip before opening.

This program comes with no warranty of any kind - use at own risk.

January 15, 2008 Posted by freescifistories | Nintendo DS | | 4 Comments

Wee Basic Keywords Updated

I have updated the keywords document for Wee Basic so that it is more helpful. I will continue to update it so that anyone can pick up programming on the DS quickly and easily.

Download: wee-basic-keywords.doc

December 3, 2007 Posted by freescifistories | Nintendo DS | | No Comments

Wee Basic 0.3 - now you can use both screens and stylus!

version 0.3

fixed:

- editor: return key swallowing a character
- editor: hopefully fixed remaining save bugs

added/changed:

- basic programs now have access to both DS screens and stylus input
- hide or show keyboard with commands ‘keyhide’ and ‘keyshow’
- you must hide the keyboard before printing to, or using graphics on, the bottom screen
- cls, print, plot and line can now be used on both DS screens. You must specify a screen number. Syntax is now (s= screen number 0 or 1):

print s [at x,y] <string or variable>
plot s x,y,colour
line s x1,y1,x2,y2,colour
cls s

(s = screen number 0 or 1)

- stylus coordinates can be obtained using stx() and sty()

eg, let sx=stx() let sxy=sty()

- check whether bottom screen has been touched with stt()

eg, let touched=stt()
stt() returns 1 for touched and 0 for not touched

- new example showing the above features

free to download: wee03.ppt (change ppt extension to zip before opening)

November 25, 2007 Posted by freescifistories | Nintendo DS | | 12 Comments

Wee Basic Keywords

Attached is a keywords list for Wee Basic that I am hoping to develop over time into a help file or manual. It was a good recommendation from axipher in the forum:

http://z3.invisionfree.com/Wee_Basic/index.php?showtopic=7

wee-basic-keywords.doc

October 27, 2007 Posted by freescifistories | Nintendo DS | | No Comments

Wee Basic: New Release

New version: alpha 2

Changes:

Alpha 2

fixed:

- no longer crashes when loading a file that doesn’t exist

added/changed:

- variable names are no longer restricted to 1 character. Wee Basic now supports variable names of up to 8 characters, starting with a letter
but can otherwise use a combination of letters and numbers. eg test, a1, string12, a1b1, hello$
- one dimensional string and numerical arrays are now supported. To use them you first have to declare them with the “dim” statement.
eg. dim a1(10) dim hello$(5)
- there is a maximum of 100 numerical and 100 string variables
- each string array is limited to 30 members
- each numerical array is limited to 100 members

-you can print at a particular position on the screen using the “print at x,y”, where each of x and y is a numerical expression

Feel free to download the attached file (Wee Basic Alpha 2 )- don’t forget to change the extension from ppt to zip before opening. If you have any feedback, comments, bug reports etc, please comment or go to the forum:

http://z3.invisionfree.com/Wee_Basic/index.php?act=idx

Some code examples will be posted on the forum as well.

October 20, 2007 Posted by freescifistories | Nintendo DS | | No Comments

A Forum is born

Thanks to a great suggestion from putzpie, a forum to discuss Wee Basic is now available at:

http://z3.invisionfree.com/Wee_Basic/index.php?

Many thanks putzpie.

September 7, 2007 Posted by freescifistories | Nintendo DS | | 2 Comments

Another Update to Wee Basic

Quote from the change log:

Alpha 1c:

fixed:

- for/next error on first parse
- let statement not ignoring white space
- assingment not ignoring white space
- boolean functions for if statement not ignoring white space
- boolean expression for if statement returning incorrect value when using brackets
- print statement not handling variables that have a value which is a negative decimal

added/changed:

- added basic graphics:
plot x,y,colour (x,y are coordinates; colour: 1-4 to display, 0 to erase). See pong demo
line x1,y1,x2,y2,colour. See pong demo

- added log(), sin(), cos(), tan() and sqrt()

- cursor moves to the top of the document after load file
- if there is an error in the basic code, cursor will move to the point of (or close to) the error after the program is ended to make it easier to debug
- you can now use up and down (as well as left and right) to navigate in the editor

Feel free to download - change the PPT extension to ZIP. The pong demo program is included in the download. Don’t forget to patch with DLDI.

Download:Wee Basic

This is a screen of the pong demo:

Wee Pong Demo

August 23, 2007 Posted by freescifistories | Nintendo DS | | 2 Comments