English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Language > Coders. AMOS

 
 
Thread Tools
Old 28 April 2020, 22:13   #1
RetrogamerRhys
Registered User

 
Join Date: Jan 2020
Location: United Kingdom
Posts: 15
Help with Amos code for guess the number game.

I get a syntax error when I run this simple program any help?

Last edited by RetrogamerRhys; 28 April 2020 at 22:21.
RetrogamerRhys is offline  
Old 28 April 2020, 22:24   #2
kamelito
Zone Friend
kamelito's Avatar
 
Join Date: May 2006
Location: France
Posts: 1,144
Show us the code
kamelito is offline  
Old 28 April 2020, 22:29   #3
RetrogamerRhys
Registered User

 
Join Date: Jan 2020
Location: United Kingdom
Posts: 15
attached is the image.
Attached Thumbnails
Click image for larger version

Name:	15881053575336626786524961211805.jpg
Views:	52
Size:	595.6 KB
ID:	67073   Click image for larger version

Name:	IMG_20200428_202934_532.jpg
Views:	40
Size:	591.7 KB
ID:	67074  

Last edited by RetrogamerRhys; 28 April 2020 at 23:22.
RetrogamerRhys is offline  
Old 28 April 2020, 23:39   #4
kamelito
Zone Friend
kamelito's Avatar
 
Join Date: May 2006
Location: France
Posts: 1,144
There is no then following the first two if
kamelito is offline  
Old 29 April 2020, 14:25   #5
Dan
Registered User
Dan's Avatar
 
Join Date: Nov 2004
Location: Germany
Posts: 473
If you use "THEN" then the command which you want to use should be in the same line, for eg:

Code:
if n<0 or n>100 then print "a number between 0 or 100" : goto ret
or without "then" but you have to have an "END IF" as in:

Code:
if n<0 or n>100 
    print "a number between 0 or 100"
    goto ret
end if

Next trouble is in:

Code:
IF n=b then print "You guessed correct";CORRECT=1
the ; is misstyped, it should be :

next trouble is in

Code:
if g$="y" then Rematch=0
Else Rematch=1
The correct usage is like with "if" and "end if":

Code:
if g$="y" 
   RMTCH=1
else
   RMTCH=0
end if
The next, not so obvious problem is the Rematch.

Amos is thinking that you are using REM command.
You will have to rename every "rematch" into something else, like RMTCH or so.

You will notice that, if you enter a variable name, (like for e.g. CORRECT) amos is converting it automatically to the uppercase.

But when you enter Rematch, it stays lowercase.
( test it by entering all uppercase letters: REMATCH, amos will convert it into RemATCH, indicating that amos is recognizing this as a Rem command ...)



p.s. if you can, change to Amos Pro, the editing with it is alot easier !

Last edited by Dan; 29 April 2020 at 15:00.
Dan is offline  
Old 29 April 2020, 17:45   #6
RetrogamerRhys
Registered User

 
Join Date: Jan 2020
Location: United Kingdom
Posts: 15
The working program after the amendments, thanks for the tips.
Attached Thumbnails
Click image for larger version

Name:	15881750418753257812106989291423.jpg
Views:	21
Size:	572.0 KB
ID:	67088  
RetrogamerRhys is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
develop AMOS code in PC/Mac slademania Coders. AMOS 6 29 November 2019 22:36
Copy code/text from PC/Notepad to AMOS Brick Nash Coders. AMOS 8 17 October 2018 09:05
Is there any way of modularize AMOS code? darkhog Coders. AMOS 9 04 April 2017 23:54
AMOS (Editor) Source Code SparkyNZ request.Apps 4 25 March 2017 00:49
What is the Backbone Number & Code? DerekAutista123 support.WinUAE 1 05 March 2016 22:36

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 22:48.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.
Page generated in 0.07967 seconds with 15 queries