Skip to main content
fixed bug
Source Link
Nasser
  • 156.1k
  • 12
  • 173
  • 396

Try and if this works for you

enter image description here

enter image description here

enter image description here

enter image description here

code

Manipulate[ {x, y}, Grid[{   {"x", Manipulator[   Dynamic[xManipulator[Dynamic[x, (x = #;  If[Abs[x - y] > 1, If[xIf[y <> 0x, y = x + 1, y = x - 1]]) &], {-2, 2, .101}]},   {"y",  Manipulator[Dynamic[y, (y = #;  If[Abs[x - y] > 1, If[yIf[x <> 0y, x = y + 1, x = y - 1]]) &], {-2, 2, .101}]}  }],   {{x, 0}, None}, {{y, 0}, None}, TrackedSymbols :> {x, y} ] 

Try and if this works for you

enter image description here

enter image description here

enter image description here

code

Manipulate[ {x, y}, Grid[{ {"x", Manipulator[   Dynamic[x, (x = #; If[Abs[x - y] > 1, If[x < 0, y = x + 1, y = x - 1]]) &], {-2,2, .1}]}, {"y", Manipulator[Dynamic[y, (y = #;  If[Abs[x - y] > 1, If[y < 0, x = y + 1, x = y - 1]]) &], {-2,2, .1}]} }],   {{x, 0}, None}, {{y, 0}, None}, TrackedSymbols :> {x, y} ] 

Try and if this works for you

enter image description here

enter image description here

enter image description here

enter image description here

code

Manipulate[ {x, y}, Grid[{   {"x", Manipulator[Dynamic[x, (x = #;  If[Abs[x - y] > 1, If[y > x, y = x + 1, y = x - 1]]) &], {-2, 2, .01}]},   {"y",  Manipulator[Dynamic[y, (y = #; If[Abs[x - y] > 1, If[x > y, x = y + 1, x = y - 1]]) &], {-2, 2, .01}]}  }], {{x, 0}, None}, {{y, 0}, None}, TrackedSymbols :> {x, y} ] 
Source Link
Nasser
  • 156.1k
  • 12
  • 173
  • 396

Try and if this works for you

enter image description here

enter image description here

enter image description here

code

Manipulate[ {x, y}, Grid[{ {"x", Manipulator[ Dynamic[x, (x = #; If[Abs[x - y] > 1, If[x < 0, y = x + 1, y = x - 1]]) &], {-2,2, .1}]}, {"y", Manipulator[Dynamic[y, (y = #; If[Abs[x - y] > 1, If[y < 0, x = y + 1, x = y - 1]]) &], {-2,2, .1}]} }], {{x, 0}, None}, {{y, 0}, None}, TrackedSymbols :> {x, y} ]