✅ Higher or lower game, variable wont show inside the loop using console.write ;-; help please!
6 Replies
on line 11 i have the variable "guesscount". But when i run it, the number 10, which is whats stored in that variable, doesnt show. Just the "Guesses Remaining" shows. why? help please!
<:please_klee:1036669081870409828>
try
Basically, Console.WriteLine doesn't take arguments they way JS's console.log does, for example. There are multiple ways to do it, this is just the most readable.
you're a legend, it works!
thank you!
What you did there is called "string interpolation", you may wanna read up on that. Other you could try for String.Format or stringbuilder - like I said, many ways to solve it.
Useful read: https://learn.microsoft.com/en-us/dotnet/csharp/how-to/concatenate-multiple-strings
How to concatenate multiple strings (C# Guide) - C#
There are multiple ways to concatenate strings in C#. Learn the options and the reasons behind different choices.
thanks! will definitely have a look! :)))
.close
!close
Closed!