nedoPC.org

Electronics hobbyists community established in 2002
Atom Feed | View unanswered posts | View active topics It is currently 28 Mar 2024 10:12



This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
[RW1] Bez "if" Robotu polegchalo... 
Author Message
Junior

Joined: 30 Nov 2003 06:40
Posts: 8
Esli kto ne znaet to "if" vo mnogih sluchayah ne nujen.
Na primer pri starte robota mojno napisat "DEF AMMO[1000] = {1}"
"DEF OBJ[2] = {FIRE,NO_AMMO}
I ETO ZAYMET 2 TAKTA!. dopustim chto nash robot chasto proveraet ne konchilis li u nego patroni i kajdiy raz delaet eto cherez "if".IF ZANEMAET TAKT!. a mjno napesat "ammo_out = AMMO[M]"
i "CALL OBJ[ammo_out] "
takim obrazam mi delaem dva massiva "OBJ" i "AMMO" v nachale
i eto zanimaet 2 takta , potom mi prisvaevaem peremenoy "ammo_out"
znachehie "AMMO[M]". 1-kogda net potronov ,0- kogda est.
potom mi obrashaemsa k masivu "OBJ" i perehodim k funkciyam "FIRE"
ili "NO_AMMO" v zavisemosti est u robota patroni ili net.I eto takta ne zanimaet! Tak mojno proverat na nalichie potronov bez poteri takta! :kruto:

Esli u kogo est eshe takie primenaemie veshi , pishite. :P


15 Dec 2003 00:41
Profile
Display posts from previous:  Sort by  
This topic is locked, you cannot edit posts or make further replies.   [ 1 post ] 

Who is online

Users browsing this forum: Google [Bot] and 15 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software.