Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Decompiled with JetBrains decompiler
- // Type: TargetReady.Module1
- // Assembly: TargetReady, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
- // MVID: 11AE42EA-88CF-462F-AC63-AE5393C940A5
- // Assembly location: C:\Users\Pavel\Desktop\Target\Demo.exe
- // Compiler-generated code is shown
- using Microsoft.VisualBasic;
- using Microsoft.VisualBasic.CompilerServices;
- using System;
- using System.Diagnostics;
- using System.Threading;
- namespace TargetReady
- {
- [StandardModule]
- internal sealed class Module1
- {
- public const short conMaxValue = (short) 15;
- public const short conSleep = (short) 30;
- public const short conStep = (short) 1;
- public const short conMaxScore = (short) 10;
- [DebuggerNonUserCode]
- static Module1()
- {
- }
- [STAThread]
- public static void Main()
- {
- VBMath.Randomize();
- while (true)
- {
- short num1;
- checked { ++num1; }
- Console.ForegroundColor = ConsoleColor.Magenta;
- Console.WriteLine("**************************************");
- Console.WriteLine("Выстрел: " + Conversions.ToString((int) num1));
- Console.WriteLine("**************************************");
- Console.ForegroundColor = ConsoleColor.White;
- Console.WriteLine("Определение X... Нажмите клавишу...");
- float number1 = Module1.GetNumber((short) 15, (short) 30);
- Console.ReadKey(true);
- Console.WriteLine();
- Console.WriteLine("X= " + Conversions.ToString(number1));
- Console.ReadLine();
- Console.WriteLine("Определение Y... Нажмите клавишу...");
- float number2 = Module1.GetNumber((short) 15, (short) 30);
- Console.ReadKey(true);
- Console.WriteLine();
- Console.WriteLine("Y= " + Conversions.ToString(number2));
- Console.ReadLine();
- short num2;
- num2 += Module1.CalcScore(number1, number2, (short) 10, (short) 1);
- Console.ForegroundColor = ConsoleColor.Yellow;
- Console.WriteLine("**************************************");
- Console.WriteLine("Шаг: " + Conversions.ToString((int) num1) + " Счет: " + Conversions.ToString((int) num2));
- Console.WriteLine("**************************************");
- Console.ForegroundColor = ConsoleColor.White;
- Console.WriteLine("Выйти? (y/Y)");
- if (Operators.CompareString(Strings.UCase(Console.ReadLine()), "Y", false) == 0)
- break;
- }
- }
- public static float GetNumber(short shrMaxValue = (short) 15, short shrSleep = (short) 30)
- {
- float num;
- while (!Console.KeyAvailable)
- {
- num += VBMath.Rnd();
- if ((double) num > (double) shrMaxValue)
- num -= (float) checked (2 * (int) shrMaxValue);
- Thread.Sleep((int) shrSleep);
- Console.Write(Strings.Space(20));
- Console.CursorLeft = 0;
- Console.Write(num);
- Console.CursorLeft = 0;
- }
- return num;
- }
- public static short CalcScore(float sngX, float sngY, short shrMax = (short) 10, short shrStep = (short) 1)
- {
- float num = (float) Math.Sqrt(Math.Pow((double) sngX, 2.0) + Math.Pow((double) sngY, 2.0));
- if ((double) num > (double) checked ((short) unchecked ((int) shrMax * (int) shrStep)))
- return (short) 0;
- return checked ((short) ((long) shrMax - unchecked (checked ((long) Math.Round((double) num)) / (long) shrStep)));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement