Hello every one, i don’t have any issue everything worked as it should but i wanted to spice up a little bit this game to look more like some one was presenting the number wizard and change things a little bit when i was writing i stumble upon this problem i wish i could make the code below using the + min + max in only one string
print (“Welcome to number Wizard”);
print (“Be prepared, to the wonders that wizard will show you”);
int max = 1000;
int min = 1;
print ("pick a random number to your head, you can choose any given number from: ");
print ( + min);
print ("to");
print ( + max);
print ("and the wizard with his vast knowledg will ask you some questions and tell you exactly the number you, thougt");
To something that could fit into one string i thought it should be something like this
print ("pick a random number to your head, you can choose any given number between ") (+ min " to " + max);
Hello bob, i’m very pleased to know that there are people active to help thanks for taking your time and help me, but see, if i do this like this, the way that i’ve understand your explanation to the print command
int max = 1000;
int min = 1;
print ("pick a random number to your head, you can choose any given number from: " + min " to " + max );
i get the following error
i’ve already tried this in the unity 4.6.9 and the one i’m using right now that is the 5.5.2f1
the string procedure that you showed me may work but counting all the the time i’ve watched the course it shouldn’t be more then 2 hours so i’m a little afraid to get a little confused and overwhelmed so i’m trying with the tools the course has showed me till now, i’m starting to believe that is not possible to use the INT function twice in the same string is that correct or am i forgetting a bracket or a inverted commas or anything like that ?
Ohhhhhhhh thanks @Rob it really helped, it worked just fine, i have just one more question so i can understand a little more if i need to put more than 2 i’ll always add the + in the end so i can concatentate every one together right ? the semi colon was ok i just coppy it wrong XD
It can obviously get a little bit messy though, and you may consider writing a custom method instead which takes care of adding all the parts together and managing the spaces and tidying up any trailing spaces etc.
I would use this sparingly though, just where you really need it.
Yea i thought that there is more easy and pratical methods to do this is just that i’m really new to programming never saw anything before but sure once i get the hang of things i’ll use this method less times.