Welcome, Guest
You have to register before you can post on our site.

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 263
» Latest member: RonaldNat
» Forum threads: 1,074
» Forum posts: 6,434

Full Statistics

Online Users
There are currently 129 online users.
» 0 Member(s) | 126 Guest(s)
Applebot, Bing, Google

Latest Threads
.tap file code not execut...
Forum: Help & Support
Last Post: Zoran
04-28-2025, 10:59 AM
» Replies: 4
» Views: 349
Exit from more than one l...
Forum: Wishlist
Last Post: Duefectu
04-23-2025, 10:06 PM
» Replies: 3
» Views: 303
put small ASM programs li...
Forum: How-To & Tutorials
Last Post: Zoran
04-18-2025, 02:02 PM
» Replies: 6
» Views: 1,608
Creating +3 Menus - Loadi...
Forum: Help & Support
Last Post: merlinkv
04-16-2025, 02:08 PM
» Replies: 6
» Views: 559
Randomize not very random...
Forum: Help & Support
Last Post: Zoran
04-08-2025, 10:40 AM
» Replies: 4
» Views: 898
Scope rules
Forum: Bug Reports
Last Post: Zoran
04-04-2025, 09:46 AM
» Replies: 2
» Views: 340
Using constants not allow...
Forum: Bug Reports
Last Post: baltasarq
03-19-2025, 10:00 PM
» Replies: 8
» Views: 1,070
404 page not found
Forum: Documentation
Last Post: boriel
03-08-2025, 07:16 PM
» Replies: 5
» Views: 2,888
Spectrum keywords codes
Forum: Bug Reports
Last Post: boriel
03-08-2025, 11:00 AM
» Replies: 1
» Views: 421
ZXodus][Engine
Forum: ZX Basic Compiler
Last Post: boriel
02-19-2025, 11:43 PM
» Replies: 69
» Views: 213,821

 
  Control codes
Posted by: rikokun - 04-18-2016, 10:02 PM - Forum: Help & Support - Replies (6)

Hi
I'm new here, so excuse me if anyone asked this before. I tryed to search for it but didnt find anything.

So i'm playing with ZX basic for last week or so and i was doing some of my usual tests.
In one of them i was trying to print out a block of characters with random ink and color. And because making a loop that will print it character by character is rather slow, i tryed to be clever. It didn't work ^_^

So my problem:

i wanted to make a string variable with control codes that i would print out. And sure enough if i do

p$="\{i5}X"
print p$

it work just fine.


Problem is when i want to put some randomness to it and do something like

i$=str(int(rnd*7))
p$="\{i"+i$+"}X"
print p$

it outputs

\{i2}X

instead of colored X. In my mind, it should work...
Am i doing something wrong?

Also, implementing AT as \{ax,y} like it works in BASin would be nice ^_^

Thanks for your help

Print this item

  [zx81] slideshow
Posted by: nitrofurano - 04-04-2016, 10:15 AM - Forum: Other Archs - Replies (2)

just a simple slideshow for zx81 (as seen at https://zxbasic.readthedocs.io/en/docs/r...rams/zx81/ )



Attached Files
.zip   example02j2_slideshow2.zip (Size: 17.34 KB / Downloads: 1114)
Print this item

  [meadows-warpspeed] first test
Posted by: nitrofurano - 03-30-2016, 08:16 PM - Forum: Other Archs - No Replies

first test for the Meadows’ Warp Speed arcade machine
( the wiki page related to this thread is at <!-- m --><a class="postlink" href="http://www.boriel.com/wiki/en/index.php/ZX_BASIC:Released_Programs_-_MeadowsWarpSpeed#test01">http://www.boriel.com/wiki/en/index.php ... eed#test01</a><!-- m --> )



Attached Files
.zip   example01b_startingtowork.zip (Size: 14.82 KB / Downloads: 771)
Print this item

  INPUT problems
Posted by: 365Ink - 03-24-2016, 09:03 PM - Forum: Help & Support - Replies (1)

INPUT wont be recognized by the compiler! Help! Is there any workaround?

Print this item

  INPUT problem
Posted by: 365Ink - 03-24-2016, 08:16 PM - Forum: Bug Reports - Replies (1)

Hello everyone!
I have this slight problem with INPUT. INPUT seems to be unrecognized by the compiler. Wherever I put input it just wouldnt work. Is there any workaround? Thanks.

Print this item

  [gx4000] some tests
Posted by: nitrofurano - 03-23-2016, 08:14 PM - Forum: Other Archs - Replies (2)

just some tests - this one is for cpc+ (gx4000) display mode 1 (as shown at <!-- m --><a class="postlink" href="http://www.boriel.com/wiki/en/index.php/ZX_BASIC:Released_Programs_-_AmstradCPC#test01_displaymode1">http://www.boriel.com/wiki/en/index.php ... splaymode1</a><!-- m --> )



Attached Files
.zip   test01m4b_mode1_putcharwritetextjoystick_zxspectrumdisplaysize.zip (Size: 15.77 KB / Downloads: 1038)
Print this item

  Wish Add Betadisk Syntax
Posted by: Luzie - 02-23-2016, 07:31 PM - Forum: Wishlist - Replies (3)

Hi,

my wish:

Can you please add Betadisk-BASIC-Syntax:

Betadisk 48k TRDOS v4 e.g.: RANDOMIZE USR 15363: REM: SAVE "X" CODE 16384,6912
or:
Betadisk 128k TRDOS v5 e.g.: RANDOMIZE USR 15619: REM: SAVE "X" CODE 16384,6912

Both change the adress of the BASIC-interpreter to point behind the REM: and than do a call to ROM
Betadisk 48k TRDOS v4 to: 15363
or:
Betadisk 128k TRDOS v5 to: 15619

and after that restore the BASIC-interpreter-pointer to the next line

Regards,

Luzie

Print this item

  Digraph Compression
Posted by: britlion - 02-15-2016, 09:20 PM - Forum: ZX Basic Compiler - Replies (7)

After reading a note by Cheveron about digraph compression ( http://foro.speccy.org/viewtopic.php?f=6...aph#p33001) I thought I'd run up the English language version to see what it looked like.

If we take http://www.math.cornell.edu/~mec/2003-20...raphs.html as a start, and work out what the value of first letter and second letter are, I get this table in the end:

Code:
1st    Frq    2nd    Frq
e    3.24        n    2.88
t    2.65        e    2.52
h    2.3        t    2.39
i    1.9        h    1.52
a    1.87        r    1.43
o    1.66        s    1.35
n    1.37        d    1.18
s    0.74        a    1.13
r    0.72        i    0.85
l    0.1        o    0.52
d    0.09        u    0.5
v    0.04        g    0.18
u    0.02        f    0.16
                l    0.09

Thinking about this, you could store these as a nybble each:
Code:
Val    bin    Lft    Rght
00    0000    e    n
01    0001    t    e
02    0010    h    t
03    0011    i    h
04    0100    a    r
05    0101    o    s
06    0110    n    d
07    0111    s    a
08    1000    r    i
09    1001    l    o
10    1010    d    u
11    1011    v    g
12    1100    u    f
13    1101    space    l
14    1110    Not Digraph    space
15    1111    Not Digraph
And if the first three bits are 1 (nybble is > 13), you could use the last 5 bits for the letters A-Z comfortably. There's even room for a few other symbols in there. You might have to use one of them to express some non compression symbol and use a separate byte for capitals (or non capitals), and other symbols. Though clearly 26 letters + space is the default for the first 27 numbers of the 5 bits. In a real world usage, you'd probably find the four most common non lowercase characters, and put those in, and then use 255 to mean "use the full next byte as the character code". This does mean that some symbols go double byte, but that's compression for you - you can always find a case that's bigger than the original.


Not done anything else with it yet, but I thought the thought experiment might be useful if you are going to allocate bits to such a compression scheme.

Print this item

  [bordun-skylancer] first test
Posted by: nitrofurano - 02-12-2016, 02:10 PM - Forum: Other Archs - No Replies

first test for the bordun’s Sky Lancer arcade machine
( the wiki page related to this thread is at <!-- m --><a class="postlink" href="http://www.boriel.com/wiki/en/index.php/ZX_BASIC:Released_Programs_-_BordunSkyLancer">http://www.boriel.com/wiki/en/index.php ... nSkyLancer</a><!-- m --> )



Attached Files
.zip   example01g_working.zip (Size: 37.79 KB / Downloads: 840)
Print this item

  [kaneko-fightingroller] first test
Posted by: nitrofurano - 02-03-2016, 11:03 AM - Forum: Other Archs - No Replies

first test for the Kaneko’s Fighting Roller arcade machine
( the wiki page related to this thread is at <!-- m --><a class="postlink" href="http://www.boriel.com/wiki/en/index.php/ZX_BASIC:Released_Programs_-_KanekoFightingRoller">http://www.boriel.com/wiki/en/index.php ... tingRoller</a><!-- m --> )



Attached Files
.zip   example01e_working.zip (Size: 38.31 KB / Downloads: 785)
Print this item