プレイ日記
κιъъιε kibbledude
whats wrong with this line? (srry 4 da questions)
2そうだね
プレイ済み
返信[1]
親投稿
MathPRG MathProgrammer
The syntax seems to be quite off... To start off, the '+' suggests you want to add the string to something. Because you did not specify what to add the string to, you get part of your error. The 'TO' command is only used in FOR loops, and labels ('@') are only used with commands like GOTO and RESTORE. The syntax for PRINT is simply: PRINT string or number or variable[,...]
0そうだね
プレイ済み
返信[2]
親投稿
MathPRG MathProgrammer
You can use the plus sign to concatenate two strings or add number values, but '+' is a binary operator. You can not use it without two values in each side of the operator.
0そうだね
プレイ済み
返信[3]
親投稿
κιъъιε kibbledude
ok... well how can i do it where when u kill the enemy it will add an item to ur bag?
0そうだね
プレイ済み
返信[4]
親投稿
Aaron Krondelo
Easy. IF EHP‹=0 THEN ITEM=ITEM+1 ENDIF
0そうだね
プレイ済み
返信[5]
親投稿
MathPRG MathProgrammer
Doing that will increase the number of total items, so unless you make a variable for each item... I would use an array for the items, to make one use DIM. DIM ITEM[10] will make a ten element array with the name ITEM, which means ten variables in the list ITEM. Then each element could represent an item, for example ITEM[3] (the third element) could represent your number of potions.
0そうだね
プレイ済み
返信[6]
親投稿
MathPRG MathProgrammer
If that number is 0, you do not have any potions, and if it's above that, then it could appear on the item list with the number of how many (which will be stored in ITEM[3] anyways). Basically this will allow you to have an item for each element of the array (doesn't have to be 10 elements) but remember it starts with element 0, and ends with one less than the number in the DIM command.
1そうだね
プレイ済み
返信[7]
親投稿
κιъъιε kibbledude
ohhhhhh. thanks!
0そうだね
プレイ済み
返信[8]
親投稿
Aaron Krondelo
Well, I meant that as a general example, referring to a specific item. But yes, his method is preferable and how you should do it.
0そうだね
プレイ済み