Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'master' of github.com:adamhope/re-amped

  • Loading branch information...
commit 085df21fe47cd4013a1ccb990681b7a9228af6d2 2 parents eb78307 + bc7e5d9
Adam Hope authored
Showing with 10 additions and 1 deletion.
  1. +9 −0 app/controllers/blocks_controller.rb
  2. +1 −1  config/routes.rb
View
9 app/controllers/blocks_controller.rb
@@ -49,6 +49,15 @@ def map
@ascii_map[block.x.to_i-min_x][block.y.to_i-min_y] = '.'
#@ascii_map[0][0] = ' '
end
+ if params[:direction] = 'north'
+ @ascii_map[params[:x].to_i-min_x][params[:y].to_i-min_y] = '^'
+ elsif params[:direction] = 'east'
+ @ascii_map[params[:x].to_i-min_x][params[:y].to_i-min_y] = '>'
+ elsif params[:direction] = 'south'
+ @ascii_map[params[:x].to_i-min_x][params[:y].to_i-min_y] = 'v'
+ elsif params[:direction] = 'west'
+ @ascii_map[params[:x].to_i-min_x][params[:y].to_i-min_y] = '<'
+ end
top_bottom = ""
(length_x + 3).times do
View
2  config/routes.rb
@@ -5,7 +5,7 @@
map.connect '/blocks/coordinate/:x/:y.:format', :controller => 'blocks', :action => 'coordinate_get_items'
map.connect '/blocks/coordinate/:x/:y/:direction/:item.:format', :controller => 'blocks', :action => 'coordinate_set_item'
- map.connect '/blocks/ascii/map.:format', :controller => 'blocks', :action => 'map'
+ map.connect '/blocks/ascii/map/:x/:y/:direction.:format', :controller => 'blocks', :action => 'map'
map.connect '/items/search/:description.:format', :controller => 'items', :action => 'search'
# The priority is based upon order of creation: first created -> highest priority.
Please sign in to comment.
Something went wrong with that request. Please try again.