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
--Start a new game | |
function new() | |
a = {" "," "," "} | |
b = {" "," "," "} | |
c = {" "," "," "} | |
player = 1 | |
print("New game started") | |
end | |
--Print board to screen |
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
package main; | |
import java.math.BigInteger; | |
/** | |
* Key class used to store the key's Component and Modulus | |
* @author obikag | |
* @since 2013-06-22 | |
*/ | |
public class Key { |
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
-- Recursive Method calculating Fibonacci Number for n | |
function fibRecursion(n) | |
if n == 0 then | |
return 0 | |
elseif n == 1 then | |
return 1 | |
else | |
return fibRecursion(n-1) + fibRecursion(n-2) | |
end | |
end |
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
--Initialise | |
SimpleCSV = {} | |
SimpleCSV.__index = SimpleCSV | |
--Create new object | |
function SimpleCSV.new() | |
self = setmetatable({},SimpleCSV) | |
self.csv_table = {} | |
return self | |
end |
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
# Method for comparing two tuples | |
def compare_tuple(tuple1,tuple2): | |
temp = [] | |
if len(tuple1) != len(tuple2): return False | |
for val1 in tuple1: | |
for val2 in tuple2: | |
if val1 == val2: | |
temp.append(val1) | |
break | |
return (len(temp) == (len(tuple1) and len(tuple2))) |
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
--Method to compare tables | |
function compare_tables(table1,table2) | |
temp = {} | |
if #table1 ~= #table2 then return false end | |
for _,v1 in pairs(table1) do | |
for _,v2 in pairs(table2) do | |
if v1 == v2 then | |
table.insert(temp,v1) | |
break | |
end |
NewerOlder