0

だから私はC#を学んでいて、単純なテキストベースのRPGを作ろうとしていますが、キャラクター作成を実行すると、これが起こり続けます:

残り 5 ポイント

力?

入力: 4

ポイント高すぎ!Enter キーを押します。

これがコードです。

public static void Start()
{
    Console.Clear();
    int charcreatepts = 10;
    Console.WriteLine ("{0} Points Left", charcreatepts);
    Console.WriteLine ("Intelligence?");
    int CCPint1 = Convert.ToInt32 (Console.ReadLine ());
    charcreatepts = charcreatepts - CCPint1;
    if (CCPint1 > charcreatepts) {
        Console.WriteLine ("Point amount too high! Press Enter.");
        Console.ReadLine ();
        Start ();
    }else{
        Console.Clear ();
            Console.WriteLine ("{0} Points Left", charcreatepts);
            Console.WriteLine ("Strength?");
            int CCPint2 = Convert.ToInt32 (Console.ReadLine ());
            charcreatepts = charcreatepts - CCPint2;
            if (CCPint2 > charcreatepts) {
                Console.WriteLine ("Point amount too high! Press Enter.");
                Console.ReadLine ();
                Start ();
            }else{
                Console.Clear ();
                Console.WriteLine ("{0} Points Left", charcreatepts);
                Console.WriteLine ("Social Skills?");
                int CCPint3 = Convert.ToInt32 (Console.ReadLine ());
                charcreatepts = charcreatepts - CCPint3;
                if (CCPint3 > charcreatepts) {
                    Console.WriteLine ("Point amount too high! Press Enter.");
                    Console.ReadLine ();
                    Start();
                }
            }
        }
    }
}

手に入れようとしているのでよろしければこの場合の残りの5ポイント、強さを使ってもいいのですが、なぜか4すら使えません。

4

1 に答える 1