Skip to content

Instantly share code, notes, and snippets.

@madmutt
madmutt / cardano-smart-contract.hs
Created September 9, 2021 07:23
Gym Coaching Session Smart Contract (Cardano)
When
[Case
(Deposit
(Role "Client")
(Role "Client")
(Token "" "")
(Constant 50)
)
(When
[Case
import Data.Char
-- Given a list of words ["apple", "banana", "coconut"] -- > "A is for Apple, B is for Banana, and C is for Coconut"
-- These two functions handle capitalisation
capitalise :: String -> String
capitalise [] = []
capitalise (x:xs) = toUpper x : xs
capitaliseList :: [String] -> [String]
@madmutt
madmutt / guessnum.hs
Last active June 29, 2021 10:40
Haskell - Simple guess the number game
import System.Random
import Data.Char (isDigit)
-- Number guessing game
-- run stack ghci --package random in terminal
-- :cd path/to/file
-- l: guessnum.hs
-- then type guessnum
checknum :: Int -> String -> IO()
@madmutt
madmutt / starman.hs
Created June 28, 2021 10:04
Starman Haskell word Game
import System.Random
-- Starman Word Game
-- run stack ghci --package random in terminal
-- :cd /path/to/file
-- l: starman.hs
-- then type starman
check :: String -> String -> Char -> (Bool, String)
@madmutt
madmutt / gist:cd1ac3a89e83f89a5088
Created January 28, 2015 15:45
Bradley Dyer Coding Standards and Methodologies

#BRADLEY DYER CODING STANDARDS AND GUIDELINES

HTML

Writing valid code

Valid code is code that meets the W3C's standards. You can check your code at any time using the W3C validator.

It is important that you understand how browsers work - this will allow you to understand the ‘why’ of best practice. We encourage you to watch this video.