Problem I. 327. (September 2013)
I. 327. Our contestants had to assemble railway tracks based on the instructions of Problem S. 76. proposed last year. That program had to create a string as an output according to the number of track elements: crossings, straight elements and arced elements. For example, if the input is 1 2 8, then the corresponding output is XEJEJJBJXBBB.
Your current task is to graphically display the track in Logo language by using the above (correct or incorrect) output string as input. As a developer environment, we recommend Imagine Logo, downloadable from http://logo.sulinet.hu.
The track image should be created by your function s76. Its input is the character string encoding different track elements. Crossings should be drawn in red, straight elements in blue, while arced elements in green. The size of a straight element should be 40 units. Besides the image itself, your procedure should also display a message whether the track is correct or not. If the track is not closed, or if there are other self-intersections than crossings, a warning should be displayed, but the track should still be drawn according to the string. If there are multiple inconsistencies, displaying one of them is sufficient.
For the solution, you should only use procedures or functions calling one another or themselves. Loops or variables should be avoided. The Imagine Logo project (i327.imp) should be submitted.
Deadline expired on October 10, 2013.
Sorry, the solution is available only in Hungarian. Google translation
Mintamegoldásként Fényes Balázs 11. osztályos budapesti versenyző munkáját közöljük: i327.imp.
7 students sent a solution. 10 points: Fényes Balázs, Németh 729 Gábor. 7 points: 1 student. 5 points: 3 students. 2 points: 1 student.