Hi
I am new to Pixaxe I have worked with basic stamp a little . What I am trying to do is use a 08M2 And A Axe133y to make something like a magic 8 ball were the user / person asking the question then push a button this will generate a random number between 1 and lets say 7 it may go up to 16 I don't know yet. I'm thinking something like
code
Random wo
w1 = w0//7+1
select case w1
Case 1
serout c.0,N2400,(254,128)
paues30
serout c.0,N2400,(253,1)
pause 30
what I am having a hard time understanding is how to use a button push to seed the random I have been looking on the forum and found some code that refers to this I just don't understand how or were to use them the codes I found are
code
Do kickrandomnumber
If pinc.o = 1 then
Gosub pushed
Do: loop while pin c.1 = 1
End if
loop
Pushed:
Random w0
w1 = w0//16+1
this is one I found another is
code
Main:
random w0
if pin c.0 = 1 then
let pins b = b1
pause 100
End if
GOTO Main
not sure what will work I hope I make sense
if it' not to much to ask I would like to know what will work and why and maybe how it woks
Thank you
David
I am new to Pixaxe I have worked with basic stamp a little . What I am trying to do is use a 08M2 And A Axe133y to make something like a magic 8 ball were the user / person asking the question then push a button this will generate a random number between 1 and lets say 7 it may go up to 16 I don't know yet. I'm thinking something like
code
Random wo
w1 = w0//7+1
select case w1
Case 1
serout c.0,N2400,(254,128)
paues30
serout c.0,N2400,(253,1)
pause 30
what I am having a hard time understanding is how to use a button push to seed the random I have been looking on the forum and found some code that refers to this I just don't understand how or were to use them the codes I found are
code
Do kickrandomnumber
If pinc.o = 1 then
Gosub pushed
Do: loop while pin c.1 = 1
End if
loop
Pushed:
Random w0
w1 = w0//16+1
this is one I found another is
code
Main:
random w0
if pin c.0 = 1 then
let pins b = b1
pause 100
End if
GOTO Main
not sure what will work I hope I make sense
if it' not to much to ask I would like to know what will work and why and maybe how it woks
Thank you
David