title: C# Terminal Game Script giving error CS0103
body: <p>so my terminal game script is showing an error that says &quot;The name 'b' does not exist in the current context&quot; but on line 19 b is defined.</p>
  <pre><code>using System;
  
  namespace Csharp_Game
  
  {
      class Program
      {
          static void Main(string[] args)
          {
              string screen1 = &quot;.-&quot;;
              string screen2 = &quot;,.&quot;;
              string screen3 = &quot;.,&quot;;
              string screen4 = &quot;,-&quot;;
              string screen5 = &quot;..&quot;;
              Console.WriteLine(screen1);
              Console.WriteLine(screen2);
              for (int i = 0; i &lt;= 250; i++)
              {
                  string b = Console.ReadLine();
              }
              if (b==&quot;right1&quot;)
              {
                  Console.WriteLine(screen1);
                  Console.WriteLine(screen3);
              }
              if (b==&quot;up1&quot;)
              {
                  Console.WriteLine(screen4);
                  Console.WriteLine(screen5);               
              }
  
          }
      }
  }
  </code></pre>