How to resolve the algorithm Logical operations step by step in the Déjà Vu programming language

Published on 12 May 2024 09:40 PM

How to resolve the algorithm Logical operations step by step in the Déjà Vu programming language

Table of Contents

Problem Statement

Write a function that takes two logical (boolean) values, and outputs the result of "and" and "or" on both arguments as well as "not" on the first arguments. If the programming language doesn't provide a separate type for logical values, use the type most commonly used for that purpose. If the language supports additional logical operations on booleans such as XOR, list them as well.

Let's start with the solution:

Step by Step solution about How to resolve the algorithm Logical operations step by step in the Déjà Vu programming language

Source code in the déjà programming language

showbool a b:
    !.( a b or a b and a b xor a b not a )

for a in [ false true ]:
    for b in [ false true ]:
        showbool a b

  

You may also check:How to resolve the algorithm Host introspection step by step in the Haskell programming language
You may also check:How to resolve the algorithm Loops/For step by step in the Fennel programming language
You may also check:How to resolve the algorithm Program termination step by step in the Julia programming language
You may also check:How to resolve the algorithm Partition function P step by step in the Wren programming language
You may also check:How to resolve the algorithm Leap year step by step in the Fermat programming language