Post by svajoklis on May 26, 2020 14:00:40 GMT -5
Welcome back to week 4.
I have checked your submissions. It was a bit of work to readjust some of your solutions to fit the exact specification in the original task - reading data from file (that is already supplied, not prefilling it), but I managed and the scores are reflected in the table below.
Tenochititlanuk's solution is the one I had the most difficulty with, since it neither followed the required output, neither did it stop at outputting numbers by ending with the largest one in the series. It had 6/8 solutions correct not taking into account what I previously said. I will give all the 6/8 points for the solution, but I have to issue a warning, that you should follow the specifications exactly. If you want to add an extra snippet of code with a fancier output/input - you can do so, but be sure to provide the "correct" solution.
I haven't found the time to submit my solution, I will have to catch up on my own, no points for me, haha!
Weekly Challenge problem #4: Square contours [level: olympiad]
On a piece of paper all square contours are unfinished. There can be k of them (1 <= k <= 4). There is only one quarter of each square contour line drawn (one of four parts that you get when you divide it in horizontal or vertical lines in equal parts, could be whichever one). The sheet of paper is scanned and turned into a digital n * m (2 <= n, m <= 10) size image, where 0 stands for white color. Other colors are coded in numbers that you get by raising 2 to some power (2^(k-1), 1 <= k <= 4). On the page there will be only a single square for each occuring color. Lines of squares that have started being drawn do not cross and do not overlap. Smallest square quarter line consists of three numbers (see the line in the example with color 1). Write a program, that finds and finishes drawing the square contours. Square contour should be completed with the same color, which is used for the given for the quarter line. If you need to, you can enlarge the digital "page", but only on edges, and only as much as you need to fit the drawn square contours. If drawn square contours cross or overlap, the colors are added up.
Note: follow the task input and output formats exactly with no extraneous characters. Your program should be able to handle multiple sets as displayed below. This lets you immediately test multiple cases with a single run of the program.
Data format: File challenge4_data.txt, first line contains number of images. For each image you get a line with the height and the width of the image. Image of the page follows. This data repeats for each image.
Output: Display your results on the screen, separating each image with a blank line. Leave out two positions for the numbers, and separate each number with spaces.
Example:
This one's a real doozie. Have fun!
Previous week's challenge:
libertybasiccom.proboards.com/thread/1079/weekly-liberty-challenge-geometric-progression
I have checked your submissions. It was a bit of work to readjust some of your solutions to fit the exact specification in the original task - reading data from file (that is already supplied, not prefilling it), but I managed and the scores are reflected in the table below.
Tenochititlanuk's solution is the one I had the most difficulty with, since it neither followed the required output, neither did it stop at outputting numbers by ending with the largest one in the series. It had 6/8 solutions correct not taking into account what I previously said. I will give all the 6/8 points for the solution, but I have to issue a warning, that you should follow the specifications exactly. If you want to add an extra snippet of code with a fancier output/input - you can do so, but be sure to provide the "correct" solution.
I haven't found the time to submit my solution, I will have to catch up on my own, no points for me, haha!
Weekly Challenge problem #4: Square contours [level: olympiad]
On a piece of paper all square contours are unfinished. There can be k of them (1 <= k <= 4). There is only one quarter of each square contour line drawn (one of four parts that you get when you divide it in horizontal or vertical lines in equal parts, could be whichever one). The sheet of paper is scanned and turned into a digital n * m (2 <= n, m <= 10) size image, where 0 stands for white color. Other colors are coded in numbers that you get by raising 2 to some power (2^(k-1), 1 <= k <= 4). On the page there will be only a single square for each occuring color. Lines of squares that have started being drawn do not cross and do not overlap. Smallest square quarter line consists of three numbers (see the line in the example with color 1). Write a program, that finds and finishes drawing the square contours. Square contour should be completed with the same color, which is used for the given for the quarter line. If you need to, you can enlarge the digital "page", but only on edges, and only as much as you need to fit the drawn square contours. If drawn square contours cross or overlap, the colors are added up.
Note: follow the task input and output formats exactly with no extraneous characters. Your program should be able to handle multiple sets as displayed below. This lets you immediately test multiple cases with a single run of the program.
Data format: File challenge4_data.txt, first line contains number of images. For each image you get a line with the height and the width of the image. Image of the page follows. This data repeats for each image.
Output: Display your results on the screen, separating each image with a blank line. Leave out two positions for the numbers, and separate each number with spaces.
Example:
Input (challenge4_data.txt) Output (screen) 2
2 2
1 1
0 1
5 6
0 1 0 0 0 0
1 1 0 2 2 2
4 4 4 0 0 2
0 0 4 0 0 2
0 0 4 0 0 01 1 1 1
1 0 0 1
1 0 0 1
1 1 1 1
0 1 1 1 1 0 0 0 0
0 1 0 0 1 0 0 0 0
0 1 0 0 1 0 0 0 0
0 1 1 3 3 2 2 2 2
4 4 4 6 4 4 0 0 2
4 0 0 2 0 4 0 0 2
4 0 0 2 0 4 0 0 2
4 0 0 2 0 4 0 0 2
4 0 0 2 2 6 2 2 2
4 4 4 4 4 4 0 0 0
This one's a real doozie. Have fun!
Previous week's challenge:
libertybasiccom.proboards.com/thread/1079/weekly-liberty-challenge-geometric-progression
Hall of Fame: | Total score | Score in last task | |
---|---|---|---|
timur77 | 3 | 1 | |
Rod | 2.18 | 0.63 | |
svajoklis | 2 | 0 | |
tenochtitlanuk | 1.95 | 0.75 | |
tsh73 | 1 | 1 |