Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## //логика игры
- var auto_lst := new List<string>;
- auto_lst.Add('C');
- auto_lst.Add('B');
- auto_lst.Add('R');
- auto_lst.Add('M');
- auto_lst.Add('G');
- auto_lst.Add('W');
- auto_lst := auto_lst.Shuffle;
- auto_lst.RemoveAt(0);auto_lst.RemoveAt(0); // вариант компьютера готов!
- Println('Вариант компьютера: ',auto_lst);
- ///
- var user_lst := new List<string>;
- for var i := 1 to 4 do
- begin
- Print($'Введите {i}-ый цвет: ');
- user_lst.Add(ReadString());
- end;
- Print('Ваш вариант: ', user_lst);
- var (cnt_plus, cnt_0) := (0, 0);
- // цвет С
- // +
- if (user_lst[0] = 'C') and (auto_lst[0] = 'C') then cnt_plus += 1
- else if (user_lst[1] = 'C') and (auto_lst[1] = 'C') then cnt_plus += 1
- else if (user_lst[2] = 'C') and (auto_lst[2] = 'C') then cnt_plus += 1
- else if (user_lst[3] = 'C') and (auto_lst[3] = 'C') then cnt_plus += 1
- // 0
- else if (user_lst[0] = 'C') and (auto_lst[1] = 'C') then cnt_0 += 1
- else if (user_lst[0] = 'C') and (auto_lst[2] = 'C') then cnt_0 += 1
- else if (user_lst[0] = 'C') and (auto_lst[3] = 'C') then cnt_0 += 1
- else if (user_lst[1] = 'C') and (auto_lst[0] = 'C') then cnt_0 += 1
- else if (user_lst[1] = 'C') and (auto_lst[2] = 'C') then cnt_0 += 1
- else if (user_lst[1] = 'C') and (auto_lst[3] = 'C') then cnt_0 += 1
- else if (user_lst[2] = 'C') and (auto_lst[0] = 'C') then cnt_0 += 1
- else if (user_lst[2] = 'C') and (auto_lst[1] = 'C') then cnt_0 += 1
- else if (user_lst[2] = 'C') and (auto_lst[3] = 'C') then cnt_0 += 1
- else if (user_lst[3] = 'C') and (auto_lst[0] = 'C') then cnt_0 += 1
- else if (user_lst[3] = 'C') and (auto_lst[1] = 'C') then cnt_0 += 1
- else if (user_lst[3] = 'C') and (auto_lst[2] = 'C') then cnt_0 += 1;
- // цвет B
- // +
- if (user_lst[0] = 'B') and (auto_lst[0] = 'B') then cnt_plus += 1
- else if (user_lst[1] = 'B') and (auto_lst[1] = 'B') then cnt_plus += 1
- else if (user_lst[2] = 'B') and (auto_lst[2] = 'B') then cnt_plus += 1
- else if (user_lst[3] = 'B') and (auto_lst[3] = 'B') then cnt_plus += 1
- // 0
- else if (user_lst[0] = 'B') and (auto_lst[1] = 'B') then cnt_0 += 1
- else if (user_lst[0] = 'B') and (auto_lst[2] = 'B') then cnt_0 += 1
- else if (user_lst[0] = 'B') and (auto_lst[3] = 'B') then cnt_0 += 1
- else if (user_lst[1] = 'B') and (auto_lst[0] = 'B') then cnt_0 += 1
- else if (user_lst[1] = 'B') and (auto_lst[2] = 'B') then cnt_0 += 1
- else if (user_lst[1] = 'B') and (auto_lst[3] = 'B') then cnt_0 += 1
- else if (user_lst[2] = 'B') and (auto_lst[0] = 'B') then cnt_0 += 1
- else if (user_lst[2] = 'B') and (auto_lst[1] = 'B') then cnt_0 += 1
- else if (user_lst[2] = 'B') and (auto_lst[3] = 'B') then cnt_0 += 1
- else if (user_lst[3] = 'B') and (auto_lst[0] = 'B') then cnt_0 += 1
- else if (user_lst[3] = 'B') and (auto_lst[1] = 'B') then cnt_0 += 1
- else if (user_lst[3] = 'B') and (auto_lst[2] = 'B') then cnt_0 += 1;
- //
- if cnt_plus = 1 then Print('+')
- else if cnt_plus = 2 then Print('+ +')
- else if cnt_plus = 3 then Print('+ + +')
- else if cnt_plus = 1 then Print('+ + + +');
- if cnt_0 = 1 then Print('0')
- else if cnt_0 = 2 then Print('0 0')
- else if cnt_0 = 3 then Print('0 0 0')
- else if cnt_0 = 4 then Print('0 0 0 0')
Advertisement
Add Comment
Please, Sign In to add comment