Forum
Recent Examples - Printable Version

+- Forum (https://www.boriel.com/forum)
+-- Forum: Compilers and Computer Languages (https://www.boriel.com/forum/forumdisplay.php?fid=12)
+--- Forum: ZX Basic Compiler (https://www.boriel.com/forum/forumdisplay.php?fid=11)
+---- Forum: Help & Support (https://www.boriel.com/forum/forumdisplay.php?fid=16)
+---- Thread: Recent Examples (/showthread.php?tid=816)



Recent Examples - jonesypeter - 08-03-2017

Hi,

Can I ask if there are recent examples programs or tutorials for ZX BASIC? I'm accustomed to Sinclair BASIC and would like to convert some Spectrum Programs, but I'm also interested in the extra capabilities that ZX BASIC provides and linking to sprite toolkits and the Game Engines like BiFrost.

The Sample Programs section of the Wiki seems a little short on content and very simplistic.

https://zxbasic.readthedocs.io/en/docs/sample_programs/

I have tried reading through the reserved words and for example clicking on the SCREEN Keyword (replacement for SCREEN$):

https://zxbasic.readthedocs.io/en/docs/library/screen/#screen

Comes up with 'There is currently no text in this page.'

I looked at the Programming Tutorials section:

https://zxbasic.readthedocs.io/en/docs/tutorials/#tutorials

There is a very old partly completed PacMan tutorial, and a couple of tutorials in Spanish.

Sorry if this post sounds negative, it's certainly not meant to be. I'm just struggling to find resources.

Thanks


Re: Recent Examples - boriel - 08-03-2017

Have you checked the examples/ directory bundled with ZX Basic?

To make ZX Basic as much compatible as possible with Sinclair BASIC, use the --sinclair command line option.

Code:
zxb --sinclair program.bas



Re: Recent Examples - boriel - 08-04-2017

Nearly 100% of that information is valid nowadays. I mean, ZX Basic is very much like Sinclair BASIC.
So if you have experience with Sinclair BASIC you should at least start doing simple programs with no hassle.

This is the most comprehensive (Spanish, translated with google translate) tutorial: http://bit.ly/2wro5o8
It's valid still today.

The most important differences with Sinclair Basic are:
  • Every IF sentence must be closed with END IF. E.g. IF a < b THEN GOTO 100: END IF
  • Line numbers are optional (see listing examples)
  • There are other differences. Use --sinclair for maximum compatibility until you're more familiarized.

There are many improvements (Functions, WHILE, DO LOOP...). But for starting this is all you need to know.
Hope this helps. Otherwise, don't hesitate to ask for help.

The wiki samples are simple but shows all of these features. Some functions are not available (ATTR, SCREEN$, POINT) by default if you don't use --sinclair flag.

Also the wiki contains a lot of general information about the language:
https://zxbasic.readthedocs.io/en/docs/syntax/


Re: Recent Examples - britlion - 08-08-2017

I seem to keep referencing this. Probably means I have to finish it.

https://docs.google.com/document/d/1vUneCCC18oXLglzoRcJdrMDUSh7vaO_tGDjzjOc8IhU

And you can get the source code for the eventual program (Berksman) from WOS.


Re: Recent Examples - boriel - 08-08-2017

My bad, I though I had put the link above! Sorry.
It's also in the Wiki, but he probably overlooked it.


Re: Recent Examples - britlion - 08-09-2017

boriel Wrote:My bad, I though I had put the link above! Sorry.
It's also in the Wiki, but he probably overlooked it.


To be fair he had seen it, which I missed "a very old pacman tutorial" Smile

I should finish it probably. But it was hard enough finishing the game! That tutorial definitely should get people a long way as is, though, and of course the source code is all available.

JonesyPeter: What are you looking for specifically, that, for, example, the PacMan tutorial doesn't cover? It does assume you've got a working knowledge of Sinclair Basic, which might be a poor assumption; but there are tutorials for sinclair basic (like the old zx spectrum manual) elsewhere.


Re: Recent Examples - boriel - 09-06-2017

jonesypeter Wrote:Hi,

Can I ask if there are recent examples programs or tutorials for ZX BASIC? I'm accustomed to Sinclair BASIC and would like to convert some Spectrum Programs, but I'm also interested in the extra capabilities that ZX BASIC provides and linking to sprite toolkits and the Game Engines like BiFrost.

The Sample Programs section of the Wiki seems a little short on content and very simplistic.

https://zxbasic.readthedocs.io/en/docs/sample_programs/

I have tried reading through the reserved words and for example clicking on the SCREEN Keyword (replacement for SCREEN$):
SCREEN$ paged updated: https://zxbasic.readthedocs.io/en/docs/library/screen/#screen