|
@@ -2,6 +2,10 @@
|
2
|
2
|
An ASCII drawing tool that supports bucket fill.
|
3
|
3
|
|
4
|
4
|
|
|
5
|
+-----
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
5
|
9
|
DrawT00L creates drawings by coordinates from a provided input file. drawT00L.rb takes two arguments, path to input file and path to the output file. Before starting to "draw", the program checks that two arguments are provided (input/output files), it also guards against running without providing arguments.
|
6
|
10
|
|
7
|
11
|
### There are four core methods:
|
|
@@ -13,4 +17,4 @@ DrawT00L creates drawings by coordinates from a provided input file. drawT00L.rb
|
13
|
17
|
|
14
|
18
|
**bucket_fill** grabs the character found in the supplied coordinates to match against its surroundings. An empty array (area_fill) is used to start checking for all candidates to be filled. As coordinates are checked they are removed from the area_fill array. On each while loop, surrounding coordinates are updated in the array covering all directions: top , bottom , left ,right.
|
15
|
19
|
|
16
|
|
-The read_input is a simple method to handle reading each line to gather instructions. The write_output method writes to the output file on each instruction. Everything is executed inside a begin block, this allows clean handling of exceptions.
|
|
20
|
+The **read_input** is a simple method to handle reading each line to gather instructions. The write_output method writes to the output file on each instruction. Everything is executed inside a begin block, this allows clean handling of exceptions.
|