プレイ日記
Marek FancyCool
trying to make a calculator
21そうだね
プレイ済み
返信[1]
親投稿
Nicole moesaku
Nice work! Here's some tips that might help you out: INPUT only reads a number as input. To get a string like "+", you should use LINPUT instead. However, just changing that won't work, because string variable names have to end in $. Therefore, that line should become: LINPUT "OPERATION (+-*/)";B$ and B should be changed to B$ elsewhere too.
4そうだね
未プレイ
返信[2]
親投稿
Nicole moesaku
It's a good idea to avoid GOTO. It's almost never necessary and tends to make programs confusing or lead to bugs. For instance, this works: IF B$=="+" THEN D=A+C IF B$=="-" THEN D=A-C etc. whereas this has a bug in it: IF B$=="+" THEN GOTO @PLUS IF B$=="-" THEN GOTO @MINUS @PLUS D=A+C @MINUS D=A-C Notice that after D=A+C is run, it ends up running D=A-C too.
3そうだね
未プレイ
返信[3]
親投稿
Nicole moesaku
This program starts with BGMSTOP and CLS to stop the music and clear the screen, but there's a more thorough way to do this that might be helpful. SNDSTOP stops all currently playing sounds, whereas BGMSTOP only stops music. ACLS resets the whole screen, whereas CLS only clears text, not graphics.
1そうだね
未プレイ
返信[4]
親投稿
SıмΞоп SimeonW
If you would like to get into the advanced part of calculator building, that uses order of operations to evaluate expressions, look up Reverse Polish Notation, which is done using the Shunting-yard Algorithm.
3そうだね
未プレイ
返信[5]
親投稿
Emma Arceus-chrome
can you abboned on me please__
0そうだね
未プレイ