maze_magic 0.2.1 → 0.2.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6a41786f8e28f775c0e38eef106df3f5780bf81f
4
- data.tar.gz: 3fb481648ce5f9539f70d564c7694c2d41a57e27
3
+ metadata.gz: cb317cd3c86320f1a7623933c05e7cd48cc8f48a
4
+ data.tar.gz: 85c9ca375dddded5129e4ac13dc3746bae3e7479
5
5
  SHA512:
6
- metadata.gz: f23d74e2a8e6e6b4e5cdeee147000c7ba84f637a56c8b89500306ccdf8bd609642d7059db49c6d2cb305473c397b965953b6ead5beeebb784afa337c3135cad9
7
- data.tar.gz: dd76c6285873e1821efd5d57ed8c11658a7e613b153790ec77f6158ed95228d57407b463c5463055979981fe555407174e08a188922a2bf7b2aa71c502d1aa11
6
+ metadata.gz: f789ce926446fc33b2b46362e00b4133c5bedb36c870c8810786b5388c8bfdffe36cab0caf6b9f5e211fe6c7a17a38d60524fe1c9fe8cdf789988caba8dbed8c
7
+ data.tar.gz: 14e2800aaf2ae2c9a0d431bdfde5b845e30e06ee2f01a5cebf521966d99e93b88a6ec6e09f9e87506d8e7187f5cab0647718213c472b784ba2dbe349f5ec62a2
data/README.md CHANGED
@@ -5,6 +5,20 @@
5
5
 
6
6
  Ruby Maze generating gem.
7
7
 
8
+ ```
9
+ _______________________________________________________________________________________________________________________
10
+ | | | _________ _____ |___ | _ | _____ | ___ |___ ___ | _ | ___ | |___ _| ___________ | |
11
+ | | | | _ | |_| |_ |___ | _| _| | | ___| | | |_ | _| | _| |_ |_ | | | |___ |_____| _ | _ | | |_| |
12
+ | |_____|_ | |_ | |_|___ | |_| | _| | _____| _| |_____| | _| | | ___|_____| ___| _ | | |___| | | |_ | |
13
+ |_______ |_| | _| | | _ | | | _|_| | _|_ |___ | | _ | | | | | |_| ___ | |___ | | | |___ | | | | _| |
14
+ |_ | ___| _| |___| | | | | | | | ___| | _|___ | | |_|_ | | | | |___|_ _____| | _____| | |_ | | |_| | | |___ |
15
+ | | | _ |_________| |___ | | _____| | | ___| |_______| | | |___| |_ | ___|_ | _ | | _|_______| | _| |
16
+ | | | |_ |_ | | _| _ |_| |___| ___| | | | ___|_ | ___| |_______|_ |_| | | ___|___| | _| _________| |_____|
17
+ | | |_ |___| |___| | ___|_ |_______| _| |___|___ ___| | | | _______| _| |_ | _____|_ | | | ___| | | |
18
+ | |___| | | | ___| | | _______| _ | _| | |_| ___| | | | |_ |_ |_ | _| |_ | | |___| _| | ___|___| |
19
+ |_________|___|_________|_____________|_______|___|_____|_____|___|_________|_____|_________|___|_________|_____________|
20
+ ```
21
+
8
22
  ## Installation
9
23
 
10
24
  Add this line to your application's Gemfile:
@@ -24,13 +38,6 @@ And then execute:
24
38
  ```ruby
25
39
  require 'maze_magic'
26
40
 
27
- def generate_maze
28
- MazeMagic::Generate
29
- .new(height: 5, width: 5)
30
- .tap { |g| g.generate_maze }
31
- .maze
32
- end
33
-
34
41
  # maze is a 2 dimensional array of these singleton objects:
35
42
  #
36
43
  # MazeMagic::Edge.instance # ' '
@@ -42,8 +49,14 @@ end
42
49
  #
43
50
  # [[Edge, HW, HW, HW, HW, Edge],[VW, P, P,VW,P,P,P, HW],...]
44
51
  #
45
- maze = generate_maze
52
+ def generate_maze(height: 5, width: 5)
53
+ MazeMagic::Generate
54
+ .new(height: height, width: width)
55
+ .tap { |g| g.generate_maze }
56
+ .maze
57
+ end
46
58
 
59
+ maze = generate_maze
47
60
 
48
61
  # optional: render in console
49
62
  MazeMagic::Renderer::ConsoleRenderer.new(cells_grid: maze).call
@@ -15,6 +15,7 @@ module MazeMagic
15
15
  end
16
16
  printer.call("\n")
17
17
  end
18
+ nil
18
19
  end
19
20
 
20
21
  def printer
@@ -1,3 +1,3 @@
1
1
  module MazeMagic
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: maze_magic
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tomas Valent