Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (TipmyPip), 18,631 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Strings question #306204
01/20/10 14:21
01/20/10 14:21
Joined: Dec 2009
Posts: 74
Romania,Bucharest
Ted22 Offline OP
Junior Member
Ted22  Offline OP
Junior Member

Joined: Dec 2009
Posts: 74
Romania,Bucharest
Hello!i got a newbie question...
i got the following code:
///////////////////////////////
#include <acknex.h>
#include <default.c>

///////////////////////////////

var a;

PANEL* pDisplay =
{
digits (10, 10, 5, *, 1, a);
flags = VISIBLE;
}

function main()
{
video_mode=7;
screen_color.blue = 150;
while(-1)
{
a = random(13);
wait(-1);
}
}


And i want to tell the engine to show me a string "word" if a = 1 and if a > 1 string is removed or hided

Last edited by Ted22; 01/20/10 14:22.
Re: Strings question [Re: Ted22] #306207
01/20/10 14:47
01/20/10 14:47
Joined: Jan 2004
Posts: 3,023
The Netherlands
Helghast Offline
Expert
Helghast  Offline
Expert

Joined: Jan 2004
Posts: 3,023
The Netherlands
Code:
///////////////////////////////
#include <acknex.h>
#include <default.c>

///////////////////////////////
var a;

PANEL* pDisplay =
{
	pos_x = 10;
	pos_y = 10;
	digits (10, 10, "var a contains the number: %.0f", *, 1, a);
	flags = SHOW;
}

function main()
{
	video_mode=7;
	screen_color.blue = 150;
	random_seed(0);
	
	while(1)
	{
		a = integer(random(13));
		if(a == 1) {
			set(pDisplay, SHOW);
		} else {
			reset(pDisplay, SHOW);
		}
		wait(-1);
	}
}



have fun with it laugh


Formerly known as dennis_fantasy
Portfolio - http://www.designorhea.com/
Project - http://randomchance.cherrygames.org/
Re: Strings question [Re: Helghast] #306210
01/20/10 14:51
01/20/10 14:51
Joined: Dec 2009
Posts: 74
Romania,Bucharest
Ted22 Offline OP
Junior Member
Ted22  Offline OP
Junior Member

Joined: Dec 2009
Posts: 74
Romania,Bucharest
it said 'random seed' uncliered indentifier

Last edited by Ted22; 01/20/10 14:51.
Re: Strings question [Re: Ted22] #306212
01/20/10 14:52
01/20/10 14:52
Joined: Dec 2009
Posts: 74
Romania,Bucharest
Ted22 Offline OP
Junior Member
Ted22  Offline OP
Junior Member

Joined: Dec 2009
Posts: 74
Romania,Bucharest
i'm using A7 btw

Re: Strings question [Re: Ted22] #306216
01/20/10 15:11
01/20/10 15:11
Joined: Dec 2009
Posts: 74
Romania,Bucharest
Ted22 Offline OP
Junior Member
Ted22  Offline OP
Junior Member

Joined: Dec 2009
Posts: 74
Romania,Bucharest
i modified it to
///////////////////////////////
#include <acknex.h>
#include <default.c>

///////////////////////////////
var a;

PANEL* pDisplay =
{
pos_x = 10;
pos_y = 10;
digits (10, 10, 5, *, 1, a);
flags = VISIBLE;
}

function main()
{
video_mode=7;
screen_color.blue = 150;
while(1)
{
a = integer(random(13));
if(a = 1)
{
set(pDisplay, VISIBLE);
}
else
{
reset(pDisplay , VISIBLE);
}
wait(-1);
}
}




and now my a == 1 and do not change,why?

Re: Strings question [Re: Ted22] #306218
01/20/10 15:16
01/20/10 15:16
Joined: Dec 2009
Posts: 74
Romania,Bucharest
Ted22 Offline OP
Junior Member
Ted22  Offline OP
Junior Member

Joined: Dec 2009
Posts: 74
Romania,Bucharest
oh,now works!Thanks!
///////////////////////////////
#include <acknex.h>
#include <default.c>

///////////////////////////////
var a;

PANEL* pDisplay =
{
pos_x = 10;
pos_y = 10;
digits (10, 10, 5, *, 1, a);
flags = VISIBLE;
}

function main()
{
video_mode=7;
screen_color.blue = 150;
while(1)
{
a = integer(random(2));
if(a == 1)
{
set(pDisplay, VISIBLE);
}
else
{
reset(pDisplay , VISIBLE);
}
wait(-1);
}
}

Re: Strings question [Re: Ted22] #306219
01/20/10 15:22
01/20/10 15:22
Joined: Jan 2004
Posts: 3,023
The Netherlands
Helghast Offline
Expert
Helghast  Offline
Expert

Joined: Jan 2004
Posts: 3,023
The Netherlands
it works, but only when the random is 1... also, what version of A7 are you using, random_seed should work... I have tested this on the latest A7 version.

regards,


Formerly known as dennis_fantasy
Portfolio - http://www.designorhea.com/
Project - http://randomchance.cherrygames.org/

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1