- The application is a simulation of a toy robot moving on a square tabletop, of dimensions 5 units x 5 units.
- There are no other obstructions on the table surface.
- The robot is free to roam around the surface of the table, but must be prevented from falling to destruction. Any movement that would result in the robot falling from the table must be prevented, however further valid movement commands must still be allowed.
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
#!/usr/bin/env python | |
# coding: utf-8 | |
# https://www.amazon.co.uk/Smart-Games-Hide-Safari-Puzzle-x/dp/B000H5V6U6 | |
# https://www.amazon.com/Smart-Tangoes-USA-SG-101/dp/B004TGVIXY | |
# https://righttolearn.com.sg/collections/iq-games/products/iq-game-animal-puzzle-433 | |
import numpy as np | |
from itertools import permutations | |
import collections |
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 reverse(str) | |
str&.reverse | |
end |
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
@answers = {0 => 0, 1 => 1} | |
def fibonnaci(n) | |
return 0 if n < 0 | |
@answers[n] ||= fibonnaci(n-1) + fibonnaci(n-2) | |
end |
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
# frozen_string_literal: true | |
require 'sinatra' | |
require 'sinatra/reloader' if development? | |
require 'sqlite3' | |
require 'pdf-reader' | |
set :environment, :development | |
DB_FILE = 'transactions.db' |
OlderNewer