This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html xmlns="http://www.w3.org/1999/xhtml"><head> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js" type="text/javascript"></script> | |
<script> | |
$.noConflict(true) | |
</script> | |
<script src="http://zeptojs.com/zepto.js" type="text/javascript"></script> | |
</head> | |
<body> | |
With jQuery in noConlict mode, Zepto is no longer assigned to $. | |
</body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def find_unique_paths(x, y, visited_points) | |
if is_at_end_point?(x, y) | |
@total_paths += 1 # successful path | |
elsif !visited_points.include?([x, y]) | |
visited_points << [x, y] # unvisited point, add to path | |
find_unique_paths(x + 1, y, visited_points.clone) if x + 1 <= @MAX_X # right | |
find_unique_paths(x - 1, y, visited_points.clone) if x > 0 # left | |
find_unique_paths(x, y + 1, visited_points.clone) if y + 1 <= @MAX_Y # down | |
find_unique_paths(x, y - 1, visited_points.clone) if y > 0 # up |