using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class OyunKontrol : MonoBehaviour
{
int minsayi = 1;
int maxsayi = 100;
int tahmin;
// Start is called before the first frame update
void Start()
{
print("Benim bir oyun oynamak ister misin? (E/H)");
}
// Update is called once per frame
void Update()
{
if (Input.GetKeyDown(KeyCode.E))
{
print("Harika! Aklından 1-100 arasında bir sayı tut ve Enter'a bas!");
}
else if (Input.GetKeyDown(KeyCode.H)) {
print("Sen Bilirsin!");
}
if (Input.GetKeyDown(KeyCode.Return)) {
Kontrol();
}
if (Input.GetKeyDown(KeyCode.UpArrow)) {
minsayi = tahmin;
Kontrol();
}
else if (Input.GetKeyDown(KeyCode.DownArrow))
{
maxsayi = tahmin;
Kontrol();
}
else if (Input.GetKeyDown(KeyCode.Space)) {
print("Yaşasın,aklındaki sayıyı buldum!");
}
}
void Kontrol() {
tahmin = (minsayi + maxsayi) / 2;
print("Aklından tuttuğun sayı " + tahmin + "mi ? Daha büyük ise yukarı,daha küçük ise aşağı yön tuşuna bas! Doğru ise boşluk!");
}
}