2 registered members (TipmyPip, 1 invisible),
18,731
guests, and 7
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Strings question
#306204
01/20/10 14:21
01/20/10 14:21
|
Joined: Dec 2009
Posts: 74 Romania,Bucharest
Ted22
OP
Junior Member
|
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]
#306216
01/20/10 15:11
01/20/10 15:11
|
Joined: Dec 2009
Posts: 74 Romania,Bucharest
Ted22
OP
Junior Member
|
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
OP
Junior Member
|
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); } }
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|