Top "Logic" questions

Logic refers to the ultimate flow of your code and how you arrive your desired solution.

Mathematical (Arithmetic) representation of XOR

I have spent the last 5 hours searching for an answer. Even though I have found many answers they have not …

math boolean logic xor algebra
Detecting sequence of at least 3 sequential numbers from a given list

I have a list of numbers e.g. 21,4,7,9,12,22,17,8,2,20,23 I want to be able to pick out sequences of sequential numbers (…

c# logic sequences
Converting logic gates to a purely NAND implementation, how come this is valid?

So Im doing some exercises with answers provided on conversion to a purely NAND gate implementation. I understand how the 2 …

logic boolean-logic boolean-operations circuit
How to implement a decision tree in javascript. Looking for a better solution than my ugly ones

I'm looking for a better way to implement a decision tree in javascript. Being very new to programming I have …

javascript logic decision-tree
Python Deleting Certain File Extensions

I'm fairly new to Python, but I have gotten this code to work, and in fact, do what it's intended …

python logic file-extension delete-file
Einsteins Riddle Prolog

I need some help with a prolog homework for my AI class. The question is to write prolog code for …

prolog logic zebra-puzzle
Determine if two strings are similar in Javascript?

Let's say I have two strings, is there any way to check if they are at least 90% similar? var string1 = "…

javascript string logic
Scala - Prefix Unary Operators

I've recently given Scala a second chance, and started with the project I always implement (in functional or pseudo-functional languages): …

scala logic notation unary-operator
Element-wise XOR in pandas

I know that logical AND is &, and logical OR is | in a Pandas Series, but I was looking for …

python pandas logic xor
C: XNOR / Exclusive-Nor gate?

I am trying to find the most effective way of writing a XNOR gate in C. if(VAL1 XNOR VAL2) { …

c logic xor