Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace WindowsFormsApp13
- {
- public class Движ : Form1
- {
- public Движ()
- {
- Random rnd = new Random();
- int caseSwitch = 0;
- switch (caseSwitch = rnd.Next(0, 3))
- {
- //Вправо
- case 0:
- if (o != 10)
- {
- p += 1;
- n += 0;
- }
- break;
- //Вниз
- case 1:
- p += 0;
- n += 1;
- break;
- //Вверх
- case 2:
- p += 0;
- n -= 1;
- break;
- //Влево
- case 3:
- p -= 1;
- n += 0;
- break;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement