Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - markjd

#1
Can someone help me please? I have been working through the tutorials and have started playing around with the RND function but have come across something I am unsure about.

A=RND(100)
B=RND(7)

PRINT A, 100, 100
PRINT B, 120, 120
SHOWSCREEN
MOUSEWAIT

If I run this it generates the numbers 72 and 1. If I run it again it generates 100 and 0. If I run it a third time it goes back to 72 and 1 and a forth time 100 and 0, which doesn't seem very random, what am I doing wrong?
#2
Tutorials / Re: Help Please
2010-Aug-26
I wondered that but there is no mention of it in the tutorial.
#3
Tutorials / Re: Help Please
2010-Aug-26
Thanks, how stupid do I feel! Promise to stop bothering you now!
#4
Tutorials / Re: Help Please
2010-Aug-26
Sorry, it is from the tutorial.

// Project: One More

DIM playfield [10] [10]
level = 0

// Main game
main:
MOUSESTATE mx, my, b1, b2
PRINT "<=", mx, my-8
SHOWSCREEN
GOTO main
END

When I try to complie and run I get:


*** Configuration: WIN32 ***
precompiling:
GPC - GLBasic Precompiler V.8.044 SN:60beea13 - 2D, WIN32
"OneMore.gbas"(8) warning : probably unassigned variable : mx
"OneMore.gbas"(8) warning : probably unassigned variable : my
"OneMore.gbas"(8) warning : probably unassigned variable : b1
"OneMore.gbas"(8) warning : probably unassigned variable : b2
Wordcount:7 commands
compiling:
C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\glbasic\gpc_temp0.cpp: In function `int __GLBASIC__::__MainGameSub_()':
C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\glbasic\gpc_temp0.cpp:25: error: void value not ignored as it ought to be
*** FATAL ERROR - Please post this output in the forum
_______________________________________
*** Finished ***
Elapsed: 1.4 sec. Time: 15:29
Build: 0 succeeded.
*** 1 FAILED ***
#5
Tutorials / Re: Help Please
2010-Aug-26
Ok So I spoke too soon! What does this mean?


*** Configuration: WIN32 ***
precompiling:
GPC - GLBasic Precompiler V.8.044 SN:60beea13 - 2D, WIN32
"OneMore.gbas"(8) warning : probably unassigned variable : mx
"OneMore.gbas"(8) warning : probably unassigned variable : my
"OneMore.gbas"(8) warning : probably unassigned variable : b1
"OneMore.gbas"(8) warning : probably unassigned variable : b2
Wordcount:7 commands
compiling:
C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\glbasic\gpc_temp0.cpp: In function `int __GLBASIC__::__MainGameSub_()':
C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\glbasic\gpc_temp0.cpp:25: error: void value not ignored as it ought to be
*** FATAL ERROR - Please post this output in the forum
_______________________________________
*** Finished ***
Elapsed: 1.2 sec. Time: 15:27
Build: 0 succeeded.
*** 1 FAILED ***
#6
Tutorials / Re: Help Please
2010-Aug-26
Thanks guys, removing the tick in explicit declarations worked.
#7
Tutorials / Help Please
2010-Aug-26
I am completely new to programming so please excuse me for being stupid. I have been working through the tutorials in the GLBasic manual, but i am having a problem. When I compile the program I get the error:  error : variable is not explicitly defined : bat_y
This is from the pong tutorial and I have even copied and pasted it to be certain I am not making a typing error.
DIM bat_y[2]
DIM bat_x[2]
DIM score[2]

Any help would be appreciated.