|
Post by mb2002 on Dec 12, 2005 10:55:48 GMT -5
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
|
|
|
Post by Cyberjank on Dec 12, 2005 14:50:45 GMT -5
Well I would change the GOTO X to represent a line number instead of the variable to start with.
Other than that, Im not sure how the network thing is going to work out for you. Please let us know of your progress!
|
|
|
Post by Pinacolada on Dec 12, 2005 18:58:52 GMT -5
There is no computed GOTO like on some other BASICs without using assembly language routines. There are several of those out there, but what you want in this case (if you want a pure BASIC solution) is ON-GOTO. 1 X=INT(RND(1)*(20-3)+3) by the way, this looks like you're trying to come up with a range of numbers? the syntax to pick 1-20 would be: INT(RND(1)*20)+1 if you want ranges, change the statement to, say X=INT(RND(1)*15)+1:X=X+10 to generate numbers between 25-35. 2 ON X GOTO 10-20 <as many line numbers as would fit> 3 ON X-<number of lines you could fit in the statement above, if there are more line numbers to go to> GOTO <more line numbers> 4 PRINT "Value out of range":END:REM catch a bad value 10 PRINT"...":GOTO 1 20 PRINT"...":GOTO 1 Hope that made some sense.
|
|