2019-01-22 15:06:03 (edited by Radiant 2019-01-22 15:07:23)

hello guys,
so, I have written a code regarding the program of which I told in my previous post.
and, the code is.
void main()
{
int= plus random 1, 1000000)
alert("hello", "lets play maths game");
alert("lets start", "think about any random number");
alert("then", "multiply that number with 2");
alert("then", "add "plus"+ to it");
alert("then", "divide the product with 2");
alert("then", "subtract the number which you thought first time");
alert("answer", "your answer is "plus" /2);
}please help me.

allow me to speak more,
catch me on Twitter
or, Mastodon

2019-01-22 15:47:11 (edited by Nuno 2019-01-22 15:48:31)

BGT is stupid but I will do an exception and help ya with this sshit.
Here is the fixed code, and I have commented the lines that I have fixed.
void main()
{
//The definition for a variable is as follows: type space name equals sign value. You forgot to open the brace and you forgot to add semicolon at the end of your statement.. You also need to create a second variable which will hold the result. It will look as follows
int plus = random (1, 1000000);
int PlusResult = plus /2;
alert("hello", "lets play maths game");
alert("lets start", "think about any random number");
alert("then", "multiply that number with 2");
alert("then", "add "+plus+" to it");
alert("then", "divide the product with 2");
alert("then", "subtract the number which you thought first time");
alert("answer", "your answer is "+PlusResult+");
}

If you want to contact me, do not use the forum PM. I respond once a year or two, when I need to write a PM myself. I apologize for the inconvenience.
Telegram: Nuno69a
E-Mail: nuno69a (at) gmail (dot) com

2019-01-22 18:19:43

On line: 11 (46)
Line: alert("answer", "your answer is "+PlusResult+");
Error: Non-terminated string literal

allow me to speak more,
catch me on Twitter
or, Mastodon

2019-01-22 18:30:15

Add one more quuotation mark after the plus sign.

If you want to contact me, do not use the forum PM. I respond once a year or two, when I need to write a PM myself. I apologize for the inconvenience.
Telegram: Nuno69a
E-Mail: nuno69a (at) gmail (dot) com

2019-01-22 23:35:27

like this:
alert("answer","your answer is"+result+"");

2019-01-23 23:16:44

The last sequence of +"" is unnecessary.
alert("answer","your answer is"+result);
is sufficient.
Unless of course you want to add a period at the end of the sentence:
alert("answer","your answer is"+result+".");
and I don't think that BGT is stupid.
It's dated, it needs to be updated to support more than just Windows, but it is a great tool for teaching programming to beginners because it can make you feel that you are accomplishing big things fairly quickly. It's all psychological, but I should think that being able to do something fairly significant like play an audio file or even have a character moving around on a game map with just a few lines is something that helps keep motivation up while learning.
If it could run on Mac and supported HRTF it would more or less be cutting edge technology again.

Official server host for vgstorm.com and developer of the Manamon 2 netplay server.
PSA: sending unsolicited PMs or emails to people you don't know asking them to buy you stuff is disrespectful. You'll just be ignored, so don't waste your time.

2019-01-24 14:49:33

thanks,
it worked

allow me to speak more,
catch me on Twitter
or, Mastodon

2019-02-05 14:02:29

hi
as guys sed your coad's problem, i'm here just to say, it have more alert alert alerts
if you could put all in one alert, that can be better

2019-02-06 10:11:45

I have made these much alert boxes just to ensure that user is going step by step

allow me to speak more,
catch me on Twitter
or, Mastodon