Tynezz
|
  |
| Joined: 28 Apr 2014 |
| Total Posts: 4945 |
|
|
| 17 Jun 2015 11:07 PM |
if (position>5){ position=0; }
What I am trying to do is if position is 6 it will become 1 again. |
|
|
| Report Abuse |
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 17 Jun 2015 11:56 PM |
is this a joke? if you wrote the above you would know how
if(position == 6) { position = 1; }
You can use the ternary operator to do it too, or if you're increasing position by 1 every blank, use the AND operator (better than modulo in this case).
position = (position + 1) & 6; |
|
|
| Report Abuse |
|
Tynezz
|
  |
| Joined: 28 Apr 2014 |
| Total Posts: 4945 |
|
|
| 18 Jun 2015 12:07 AM |
| I wasn't thinking. Just learnt the basics yesterday. |
|
|
| Report Abuse |
|