0

You need to enter a Boolean algebra formula, for example X v Y, convert it into a postfix form - XYv and calculate the result. The X and Y values ​​(1 or 0) are set by the user. I made an algorithm that converts simple expressions like X v Y, X ^ Y (v, ^ - disjunction, conjunction). But there is a need for an algorithm that can transform a more complex expression, for example: ~X v Y -> Y.

let temp = "XvY"
let X = 0
let Y = 0
function first(){
     let form = ""
     form += temp[0]
     form += temp[2]
     form += temp[1]
     console.log(form)
 }
first()
user526218
  • 37
  • 4

0 Answers0