Skip to first unread message

Gale Fulton

unread,
Dec 30, 2016, 1:45:29 AM12/30/16
to MIT App Inventor Forum
Hi all,

So far, for my first time coding, I have come a LONG way.  But this, I believe, is a bit beyond my understanding.  (relevant blocks are posted below)

I am making a football sim.  What I am having trouble with is the downs:

What I need:

    If "downs" text > "4" and "Offense" text = "o" and "YTG" text < "1"
    Then:  set Downs Text to 1
                

    If "downs" text > "4" and "Offense" text = "o" and "YTG" text > 1
    Then:  set Downs Text to 1
                set Offense text to "x"

I thought I had it right with the below blocks, but it changes the "Offense" text no matter what.

I just realized that this pic doesn't have any reference to YTG being reset.  

Any Help would be appreciated!  (I don't mean to sound rude, but a vague answer like "have you tried making a list" or something like that will not help me with this.  I am asking for an education here please)


                
               

Taifun

unread,
Dec 30, 2016, 7:47:10 AM12/30/16
to MIT App Inventor Forum
use Do it to debug your blocks, see also tip 4 here


also to simplify you could change your blocks to

  If "downs" text > "4" and "Offense" text = "o" 
  Then::
     set Downs Text to 1
     If YTG" text > "1"
     Then:  
        set Offense text to "x"

Taifun

Trying to push the limits of App Inventor! Snippets, Tutorials and Extensions from Pura Vida Apps by Taifun.         

Abraham Getzler

unread,
Dec 30, 2016, 10:27:32 AM12/30/16
to MIT App Inventor Forum
Those green nested logic blocks will be more readable if you switch them to external input form with the right click block menu.

External input form lets you (and us) see the nesting more clearly.

ABG

Gale Fulton

unread,
Dec 31, 2016, 1:00:31 PM12/31/16
to MIT App Inventor Forum
Thank you both.  I appreciate it.  Sooner or later my work will be less messy, but I am having a ton of fun with this.  I thought I was too old to do this stuff.  (my 100 year old is the one who told me about APP Inventor.  They have a class on it in his school...all I had in school was Reading, English, Math and History...lol)

Gale Fulton

unread,
Dec 31, 2016, 1:06:31 PM12/31/16
to MIT App Inventor Forum
ABG...Thank you for that input!  SO much easier to organize my blocks and that is basically how I visualize the code when I am thinking about what I need to do.
Reply all
Reply to author
Forward
0 new messages