## How to simplify a group of Logic Blocks? - SOLVED

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller

DR White
Posts: 514
Joined: Fri Aug 23, 2013 12:29 pm
Location: Virginia, USA

### How to simplify a group of Logic Blocks? - SOLVED

The Letters “A,B…” are either a 1 or a 0. Is the a simple way to write this function without a lot of “If” statements?

The result needs to be a 0 or a 1.

Thanks,

David
Attachments
simplify a group of Logic Blocks?
Last edited by DR White on Fri May 22, 2020 1:45 pm, edited 1 time in total.

Thierry
VIP Livecode Opensource Backer
Posts: 745
Joined: Wed Nov 22, 2006 3:42 pm
Location: France
Contact:

### Re: How to simplify a group of Logic Blocks?

Well, if I understand the problem,
you could go this way:

I've replaced 0 and 1 with false and true,
much better for boolean operations.

Code: Select all

``````   local A, B, C, D, E, F, G, H
put true into A
put false into B
put false into C
put false into D
put true into E
put true into F
put false into G
put false into H

put (A or B) and ( C or D) and ( E and F) and ( G or H)
``````
Hope this give you some ideas...

Thierry
Regex LiveCode sunnYrex
https://sunny-tdz.com

DR White
Posts: 514
Joined: Fri Aug 23, 2013 12:29 pm
Location: Virginia, USA

### Re: How to simplify a group of Logic Blocks?

Thierry,

That works BEAUTIFULLY!

THE LC FORUM IS THE BEST,

DAVID