| |
burton1 Account closed
Registered: Dec 2005 Posts: 3 |
c64 for arts sake
i am using the c64 for an art work which i am making at present, as such i am having to teach myself from scratch to operate and program the c64. i am still struggling with the technical aspects of the project so any help would be muchly appreciated. the project goes a little something like this;
4 c64s are to be networked.
each c64 is to run a program which randomly selects a piece of info from a list (at present i am trying to write this program and utilize the random number generator built into basic however the command which looks a little like this,
1 X=INT(RND(1)*(20-3)+3)
2 GOTO X
3 PRINT"...
4 PRINT"...
does not want to work) and then the data is to be sent over the network to the 4th c64 which compiles the data and prints it out on my printer as well as dropping it into an e-mail which will then be sent out to set addresses.
i am at the moment hoping to build "the final ethernet" from the schematics on the TFE website and use contici as my server and e-mail client.
if anyone has any advise to do with any aspect i would be extremely, extremely grateful.
thanks |
|
| |
Krill
Registered: Apr 2002 Posts: 2980 |
Looks like lots of technical hassles without much gain. Why send random numbers over a network? Why ethernet? Why e-mails? I don't get it. :D |
| |
VanessaE
Registered: Jan 2005 Posts: 3 |
The problem here is that C64 BASIC doesn't allow you to use a variable with the GOTO command. Rather, you probably need to use an ON/GOTO command instead. For example, your code would probably read more like this:
1 X=INT(RND(1)*(20-3)+1)
2 ON X GOTO 3,4,5,6,7,...
3 PRINT"...
4 PRINT"...
Alternatively, a better method is to use an array, for example:
10 DIM X$(20)
20 FOR X=1TO20: READ X$(X): NEXT: REM FILL THE ARRAY FIRST
30 :
40 X=INT(RND(1)*20+1): REM NOTE THE CHANGE HERE.
50 PRINT X$(X)
60 ... do whatever else you need, loop, etc.
99 END
1000 DATA "This is the first line to be selected from"
1010 DATA "This is the second..."
1020 DATA "This is the third..."
And so on for however many lines you need to select from.
|
| |
JackAsser
Registered: Jun 2002 Posts: 2014 |
Hmmm, dim x$(20)? When I did my BASIC twister on LCP I couldn't have more than 10 entries for an array of strings. Is 20 actually possible? |
| |
ready.
Registered: Feb 2003 Posts: 441 |
This thread has alread been started as the discussion "Help me create something special!!!". |
| |
Oswald
Registered: Apr 2002 Posts: 5094 |
jackasser: ROTFL :) ofcourse c64 basic is not that lame, only the memory limits the arrays :) |
| |
iopop
Registered: Dec 2001 Posts: 317 |
Interesting, this thread was also started at lemon64.com. The very same suggestions was made there, ie. ON GOTO and using arrays instead.. |
| |
Slartibartfast Account closed
Registered: Jul 2002 Posts: 230 |
Hrm. Seems more like "C64 for insanity's sake".
Burton: You'd be best posting something like this on comp.sys.cbm |
| |
Graham Account closed
Registered: Dec 2002 Posts: 990 |
I remember that in one issue of the 64'er magazine there was a description how to do a GOTO X. |
| |
JackAsser
Registered: Jun 2002 Posts: 2014 |
@Oswald: Sorry man, but hey I'm not the BASIC coder, YOU are!! (ProjectOne =) ) |
| |
Oswald
Registered: Apr 2002 Posts: 5094 |
jackasser: hehe, ok I have to admit, I first learned c64 basic, and been coding stuff in it for years before going for asm. |
... 6 posts hidden. Click here to view all posts.... |
Previous - 1 | 2 - Next |