alexandruradovici / alf-robot-language-public Goto Github PK
View Code? Open in Web Editor NEWLicense: BSD 2-Clause "Simplified" License
License: BSD 2-Clause "Simplified" License
I have an issue with the tests from the 5_extra folder. When I try them, the output is shifted with either 1 or 2 pixels. I use Math.round as you said on the other issue regarding shifting that Catalin posted and my other tests that have TURN and FORWARD/BACKWARD work fine, but these 3 don't. Any idea where the problem is?
FORWARD 10
TURN left,20 // In vmchecker the output for this line is an error (no of param = 0). Is it correct?
BACKWARD 5
REPEAT 7
FORWARD 6
END
Why is the first output from repeat the initial position?
when I run my program the output is just fine (without repeat) but it does not pass any test and I just don.t know why? can you please take a look and tell me what is going on?
Verifying Lots of statements results with error.
I have stored all the output in a text file and when I compared the output file with the expected output (repeat.s.out) I got a full match.
I used the plugin compare from notepad++.
Any hints on what might be wrong?
I uploaded the archive.zip into vmchecker, and it says "Eroare la citire" for all the tests. When i run the program in the console i write "node main.js robot_commands.s", supposing that the file "robot_commands.s" is the source file where all the commands are stored. Can you please explain why it gives me that error?
EDIT: fixed it.
For the TURN parameters error we have on the homework page:
ERROR LINE (line_number): TURN has 2 parameters, your wrote (number_of_written_parameters)
but on vmchecker it is expected:
ERROR LINE (line_number): TURN has 2 parametres, your wrote (number_of_written_parameters)
It should be parameters instead of parametres.
If the REPEAT function if supposed to repeat for "X" number of times everything until it reaches an END command, then why it displays an error when it repeats 0 times?
<<# Repeat 0 with error
REPEAT 0
FORWARD 10
TEXT
END>>
<<OK 0, 0, 90
ERROR LINE 4: Unknown command TEXT>>
If in the commands file of the robot i have an empty row, should my code skip it like its not there or keep it in memory so that the number of the error in the commands file is the same printed by the console?
Ex: alf-robot-language-public/verify/robot/2_jump/jump_error.s
"# Jump error
turn right, 8
forward 8
jump ,0
turn right, 352
"
Output: alf-robot-language-public/verify/robot/2_jump/jump_error.s.out
"OK 0, 0, 82
OK 8, 1, 82
ERROR LINE 4: jump parameter 1 requires a number or ~, you wrote
OK 8, 1, 90"
The example :
"& Move //so i guess this line is a comment
POSITION 200, 200 //which makes this line 1
COMMAND_WITH_ERROR // line 2
LINE position 300, 350 // line 3" --> this is the example that you gave(with some of my notes) and the error is: "ERROR LINE 2: Unknown statement STATEMENT_WITH_ERROR" ( example that makes me belive that the lines 1 and 3 are fine considering the "intentional" error on line 2..or am I wrong?)
assuming that so far I got it right..later in the instructions I found the format of a valid statement:
" STATEMENT : parameter1 parameter2 etc" , which makes all the 3 lines in the example wrong :
line 1 : missing ":"
line 3 : also missing ":" and a second statement on the same line ("position") which is not even uppercased; assuming it's a parameter it should be a variable (but it's still an error because it has not been declared first and it's bad format..it should be %position)
also, later in the instructions i come upon this format :
position > 150 150
position > %here %there --> with %here and %there variables previously decalred ; still no ":" but here i find ">" ..is this still a valid format? also the statement(position) is still not uppercased, and it's mentioned in the instructions that everything is case sensitive
FInally my questions:
Thank you
Can you please check if the MORE_REPEAT test is ok? Because my program passes other tests from the bonus, but with this one, my (x,y) are shifted with 3 pixels, but the angle is good and i don't understand where the error comes from.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.