This file contains hidden or 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
############################################################################ | |
# Christian Paul Dehli | |
# | |
# This .py file demonstrates functionality that can be used to determine | |
# how much of a scene is visible to a robot (where certain obstacles block | |
# its line of sight). The functionality was needed for a game, so pinpoint | |
# accuracy was not required. | |
# | |
# The algorithm works by shooting rays out of the robot into the scene. | |
# Whenever a ray strikes an obstacle, the ray is deleted and the robot's |
This file contains hidden or 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
#!/bin/bash | |
# A script that automatically compiles and runs Haskell files | |
# First paramter is the Haskell file | |
# Temporary file location | |
temp=~/../../tmp | |
# Compile Haskell file |
This file contains hidden or 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
# This function finds all the prime numbers that are less than a certain value | |
# getPrimes(10) would return [2, 3, 5, 7] | |
def getPrimes (n): | |
primes = [] | |
for i in range(2, n): | |
isPrime = True | |
for primeVal in primes: | |
# Has a factor | |
if i % primeVal == 0: |
NewerOlder