N
N
NQUARE2020-12-27 07:36:58
C++ / C#
NQUARE, 2020-12-27 07:36:58

How to make this condition shorter (working with bits)?

Here is the condition, I know what can be reduced:

if (!bRead(map, 1) && !bRead(map, 2) && !bRead(map, 3) && !bRead(map, 4) && !bRead(map, 5))

But I don't know how to do it.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
Therapyx, 2020-12-27
@Therapyx

On my sleepy logic - no way.
Imagine that each bRead is A, B, C .... It turns out that:
!A and !B and !C and !D and !E, there is not even a single one or something to think about. Just make minor changes.
In this case, you can only reduce your task and the number of parameters, but in your question there is already too little applied information for this.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question