-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Purpose of using a BREAK in CASE structure #31
Comments
You would need to edit You may wish to look at |
I'm sorry but how would i do this part create custom logic to figure out whether you have reached the end of the case branch |
You would need to replace the usage of |
I try it to do that but i got unexpected token and sometimes i get CASE is missing error. if you have the code to solve this issue, can you write it here. I really appreciate your help. Thank you. |
i tried to write it this way but i still get an error:
|
You shouldn't need to edit that function other than changing the line assigning to |
def case_branch_stmt_list (self,line):
that is what i tried to do but still i get an error |
You need to add a bit which looks ahead for the start of the next case branch. |
can you give me more details plaese |
Where you are checking for |
I did it this way and it works def stmt_block2(self,line):
|
I don't see how that would work for case branches containing more than one statement.
|
yes you are right it only executes one line after the matching CASE. But you have another bug in your code for example INPUT X[Count] This generates an error and this syntax is accepted in the pseudocode guide. Same for 2-Darray This code does not work INPUT X[i,j] |
I don't think input directly into an array is mentioned in the pseudocode guide. |
it was given in many mark schemes |
DECLARE a : INTEGER CASE OF a do you have any solution for this issue |
I was able to fix this problem and the code can handle this code DECLARE a : INTEGER CASE OF a without using the BREAK at end of each case. Thank you so much |
can you send the link to download the code for the editor and how it can be installed and run on a server. Thank you |
Can i remove the BREAK key word from the CASE structure since it is not required in the Cambridge pseudocode guide.
If yes what are the changes that i need to make to the code to do that.
Thanks
The text was updated successfully, but these errors were encountered: