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
module SAP where | |
import Data.Function | |
import Data.List | |
import Data.List.Split | |
import System.IO | |
data Token = Token {colour :: Colour, value :: Int} | |
deriving (Eq) |
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
import java.util.Scanner; | |
public class Temp{ | |
public static void main (String [] args) { | |
Scanner scan = new Scanner(System.in); | |
int n = scan.nextInt(); | |
if (n == 1) {System.out.println("2");} | |
if (n == 2) {System.out.println("4");} | |
if (n == 3) {System.out.println("8");} |
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
--Create functions to do the following: | |
{- Solutions to the questions I gave last week. | |
Note: This is the way I would answer these questions. In Haskell, there | |
are usually many ways to get the same solution, so dont worry if | |
any of your answers are different. If you have a solution that is | |
different, please lete me know. | |
If you have any questions, please ask me. Use the Moodle Forum, the | |
facebook group or the email address I posted on the Facebook page. I am |
NewerOlder