Ymn_75
Picopat
- Katılım
- 1 Şubat 2024
- Mesajlar
- 50
- Çözümler
- 2
Daha fazla
- Cinsiyet
- Erkek
Oyunun kodunu girdim ama şu hatayı alıyorum Assets/kod.cs(53,6) error CS1513:} expected hatası alıyorum.
Kodum:
Using System. Collections;
Using System. Collections. Generic;
Using unityengine;
Public class kod: Monobehaviour.
{
İnt minsayi = 1;
İnt maxsayi = 100;
İnt tahmin;
// Start is called before the first frame Update.
Void Start()
{
Print("başlatayım mı? (E/H)");
}
// Update is called once per frame.
Void Update()
{
İf (ınput. Getkeydown(keycode. E))
{
Print("1-100 arası bir sayı tut");
}
Else if (Input.GetKeyDown(KeyCode.H)) {
Print("neden hayır dedin!");
}
İf (ınput. Getkeydown(keycode. Return))
{
Kontrol();
}
İf (ınput. Getkeydown(keycode. Uparrow))
{
Minsayi = tahmin;
Tahmin = (minsayi + maxsayi) / 2;
kontrol();
}
İf (ınput. Getkeydown(keycode. Downarrow))
{
Maxsayi = tahmin;
kontrol();
}
Else if (ınput. Getkeydown(keycode. Space)) {
Print("buldum");
}
Void Kontrol() {
Tahmin = (maxsayi + maxsayi) / 2;
Print("tuttuğun sayı" + tahmin + "bu mu? Daha büyük ise yukarı ok daha küçük ise aşağı ok doğruysa boşluğa bas");
}
}
Kodum:
Using System. Collections;
Using System. Collections. Generic;
Using unityengine;
Public class kod: Monobehaviour.
{
İnt minsayi = 1;
İnt maxsayi = 100;
İnt tahmin;
// Start is called before the first frame Update.
Void Start()
{
Print("başlatayım mı? (E/H)");
}
// Update is called once per frame.
Void Update()
{
İf (ınput. Getkeydown(keycode. E))
{
Print("1-100 arası bir sayı tut");
}
Else if (Input.GetKeyDown(KeyCode.H)) {
Print("neden hayır dedin!");
}
İf (ınput. Getkeydown(keycode. Return))
{
Kontrol();
}
İf (ınput. Getkeydown(keycode. Uparrow))
{
Minsayi = tahmin;
Tahmin = (minsayi + maxsayi) / 2;
kontrol();
}
İf (ınput. Getkeydown(keycode. Downarrow))
{
Maxsayi = tahmin;
kontrol();
}
Else if (ınput. Getkeydown(keycode. Space)) {
Print("buldum");
}
Void Kontrol() {
Tahmin = (maxsayi + maxsayi) / 2;
Print("tuttuğun sayı" + tahmin + "bu mu? Daha büyük ise yukarı ok daha küçük ise aşağı ok doğruysa boşluğa bas");
}
}