Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.58 KB | None | 0 0
  1. private void _1_1_Click(object sender, RoutedEventArgs e)
  2. {
  3. if (radar.IsChecked == true)
  4. {
  5. if (gridarray[0,0] == 1)
  6. {
  7. Random rnd = new Random();
  8. int r = rnd.Next(0,3);
  9. _1_1.Content = images[r];
  10. streak.Content = streakn++;
  11. }
  12. if (gridarray[0,0] == 2 || gridarray[0,1] == 2)
  13. {
  14. Random rnd = new Random();
  15. int r = rnd.Next(3, 5);
  16. _1_1.Content = images[r];
  17. streak.Content = streakn++;
  18. }
  19. if (gridarray[0,0] == 3 || gridarray[0,1] == 3 || gridarray[0,2] == 3)
  20. {
  21. Random rnd = new Random();
  22. int r = rnd.Next(5, 7);
  23. _1_1.Content = images[r];
  24. streak.Content = streakn++;
  25. }
  26. }
  27.  
  28. private void defineImages()
  29. {
  30. images[0].Source = new BitmapImage(new Uri("Resources/small1.png", UriKind.Relative));
  31. images[1].Source = new BitmapImage(new Uri("Resources/small2.jpg", UriKind.Relative));
  32. images[2].Source = new BitmapImage(new Uri("Resources/small3.png", UriKind.Relative));
  33. images[3].Source = new BitmapImage(new Uri("Resources/medium-1.jpg", UriKind.Relative));
  34. images[4].Source = new BitmapImage(new Uri("Resources/medium2.jpg", UriKind.Relative));
  35. images[5].Source = new BitmapImage(new Uri("Resources/large1.png", UriKind.Relative));
  36. images[6].Source = new BitmapImage(new Uri("Resources/large2.jpg", UriKind.Relative));
  37.  
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement