Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace KartojimasND1
- {
- class Program
- {
- static void Main(string[] args)
- {
- //1.Uzduotis
- string user = "admin";
- string pass = "1234";
- string input = "";
- bool teisingai = false;
- while (!teisingai)
- {
- Console.WriteLine("prasome ivesti prisijungimo varda");
- input = Console.ReadLine();
- if (input != "admin")
- Console.WriteLine("NETEISINGAI!!!");
- else
- teisingai = true;
- }
- Console.WriteLine("prasome ivesti prisijungimo slaptazodi");
- string slaptas = Console.ReadLine();
- if (pass != slaptas)
- {
- Console.WriteLine("Neteisingas vartotojo slaptazodis");
- }
- else
- Console.WriteLine("Sveikiname prisijungus");
- Console.ReadLine();
- // 2.Uzduotis
- int jega;
- int taiklumas;
- string ginklas = "";
- Random rnd = new Random();
- jega = rnd.Next(1, 7);
- taiklumas = rnd.Next(1, 7);
- Console.WriteLine("Radai sautuva(1) ir kastuva(2)");
- string input = Console.ReadLine();
- if (input == "1")
- {
- ginklas = "sautuvas";
- }
- else
- ginklas = "kastuvas";
- Console.WriteLine("Zaidejuo jega: " + jega + ",taiklumas: " + taiklumas + ",ginklas: " + ginklas);
- Console.WriteLine("Sutikai zombi! Begi ar kovoji?");
- string ats = Console.ReadLine();
- if (ats == "begu")
- {
- int sk = rnd.Next(1, 7);
- if (sk > 3) {
- Console.WriteLine("Spejai pabegti");
- }
- else if (sk < 3)
- {
- Console.WriteLine("Zombis tave suvalge");
- }
- Console.ReadLine();
- }
- else if (ats == "kovoju")
- {
- int sk1 = rnd.Next(1, 7);
- if (input == "1")
- {
- taiklumas += sk1;
- Console.WriteLine("Tavo taiklumas: " + taiklumas);
- if (taiklumas > 5)
- {
- Console.WriteLine("Laimejai");
- }
- else if (taiklumas < 5)
- {
- Console.WriteLine("Pralaimejai");
- }
- }
- else if (input == "2")
- {
- jega += sk1;
- Console.WriteLine("Tavo jega: " + jega);
- if (jega > 5)
- {
- Console.WriteLine("Laimejai");
- }
- else if (jega < 5)
- {
- Console.WriteLine("Pralaimejai");
- }
- }
- Console.ReadLine();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement