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
| void goal(){ | |
| expr(); | |
| } | |
| void expr(){ | |
| term(); | |
| exprPrime(); | |
| } | |
| void exprPrime(Token t){ |
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
| 2010 | |
| ==== | |
| (0* 1 0* 1 0*) | ( 1* 0 1* 0 1*)* | |
| 2011 | |
| ==== | |
| (-)? ([0-9])+ ('.' ([0-9])+)? | |
| 2011R | |
| ===== |
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
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <pthread.h> | |
| void * handler(void* setin) { | |
| int sig; | |
| sigset_t set = (sigset_t *) setin; | |
| while(1) { | |
| sigwait(&set, &sig); |
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
| data Tree t = Empty | Root t (Tree t) (Tree t) | |
| deriving (Eq, Ord, Show) | |
| insert :: (Ord a) => a -> (Tree a) -> (Tree a) | |
| insert a Empty = Root a Empty Empty | |
| insert a (Root x left right) | |
| | a == x = (Root x left right) | |
| | a < x = Root x (insert a left) right | |
| | a > x = Root x left (insert a right) |
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
| import org.w2mind.net.Action; | |
| import org.w2mind.net.Mind; | |
| import org.w2mind.net.RunError; | |
| import org.w2mind.net.State; | |
| public class SkeletonChessMind | |
| implements Mind { | |
| int a = 8; | |
| public void endrun() throws RunError { } |
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
| data BinTree t = Empty | Root t (BinTree t) (BinTree t) | |
| deriving (Eq, Ord, Show) | |
| myTree = Root 5 (Root 1 (Empty) (Root 3 Empty Empty)) | |
| (Root 7 Empty Empty) | |
| insert :: Ord a => a -> BinTree a -> BinTree a | |
| insert new Empty = Root new Empty Empty | |
| insert new (Root n left right) | |
| | new > n = Root n left (insert new right) |
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
| /** | |
| * The following program is based of the first CA213 continuous exam. | |
| * It is wrote from memory so it may have a few errors, but it is mostly | |
| * the same. | |
| * | |
| * The exam required you to: | |
| * 1) Create a interface Printable with method put. | |
| * 2) Modify the given Date class to implement Printable and to have a put | |
| * method | |
| * 3) Create a program, PastDates which reads in dates from the console. Stores |
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
| mean :: [Int] -> Int | |
| mean [] = error "Empty List" | |
| mean a = (mean' (listSum a) (length a)) | |
| mean' :: Int -> Int -> Int | |
| mean' sum length = div sum length | |
| listSum :: Num a => [a] -> a | |
| listSum [] = 0 | |
| listSum (a:as) = a + (listSum as) |
NewerOlder

