P
P
parusa2021-12-01 20:23:26
C++ / C#
parusa, 2021-12-01 20:23:26

Closed chain, how to avoid it?

So I have the code:
let
's start with sideUp = 1
sideBehind = 3
sideDown = 6
sideForward = 4
Here's the shenanigans:
sideUp = sideBehind;
sideBehind = sideDown;
sideDown = sideForward;
sideForward = sideUp;
The result of this code will be:
sideUp = 3 sideBehind
= 6 sideDown
= 4
sideForward = 3 I changed sideUp first No matter how I change the order of the rows, it will be a closed chain How to avoid it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
freeExec, 2021-12-01
@parusa

Create a temporary variable. I'm afraid to even imagine what you would do, you need to swap only 2 variables A <=> B

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question