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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>阴阳怪气</title> | |
| </head> | |
| <body> | |
| <h1>阴阳怪气生成器</h1> |
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 file contains default non-project-specific settings for 'stack', used | |
| # in all projects. For more information about stack's configuration, see | |
| # http://docs.haskellstack.org/en/stable/yaml_configuration/ | |
| # The following parameters are used by "stack new" to automatically fill fields | |
| # in the cabal config. We recommend uncommenting them and filling them out if | |
| # you intend to use 'stack new'. | |
| # See https://docs.haskellstack.org/en/stable/yaml_configuration/#templates | |
| setup-info: "http://mirrors.tuna.tsinghua.edu.cn/stackage/stack-setup.yaml" | |
| urls: |
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 javax.swing.*; | |
| import java.awt.*; | |
| public class Stopwatch extends JFrame { | |
| public static void main(String[] s) { | |
| JFrame j = new JFrame(); | |
| j.setVisible(true); | |
| j.setSize(200, 300); | |
| j.setResizable(false); |
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
| module Calculator (evaluate) where | |
| import Text.ParserCombinators.Parsec | |
| import Data.Either (fromRight) | |
| -- evaluate | |
| evaluate :: String -> Double | |
| evaluate s = fromRight (error "Parse Error!") $ parse expr "" 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
| module Hamming (ham1, ham2) where | |
| ham1 :: [Integer] | |
| ham1 = 1 : | |
| map (* 2) ham1 `merge` | |
| map (* 3) ham1 `merge` | |
| map (* 5) ham1 | |
| merge :: Ord a => [a] -> [a] -> [a] | |
| merge [] l = l |
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
| module Hamming (ham1, ham2) where | |
| ham1 :: [Integer] | |
| ham1 = 1 : | |
| map (* 2) ham1 `merge` | |
| map (* 3) ham1 `merge` | |
| map (* 5) ham1 | |
| merge :: Ord a => [a] -> [a] -> [a] | |
| merge [] l = l |
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
| module Main where | |
| initN :: (Integer, Integer) | |
| initN = (2, 5) | |
| primes :: [Integer] | |
| primes = filter (\k -> null [ x | x <- [2..k - 1], k `mod` x == 0]) [3..73] | |
| getNextN :: (Integer, Integer) -> Integer -> (Integer, Integer) | |
| getNextN (n1, n2) m = case take 2 $ filter (f m) [n1, n2..] of |
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
| #lang scheme | |
| (define (next-line-pascal line) | |
| (let ([p (append line '(0))] | |
| [q (append '(0) line)]) | |
| (map (lambda (m n) (+ m n)) p q))) | |
| (define (pascal n) | |
| (define lst (list (list 1))) | |
| (for ([i (range n)]) |
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
| module SafePrintf | |
| data Format = | |
| FNum Format | |
| | FStr Format | |
| | Lit String Format | |
| | End | |
| -- String to Format | |
| toFormat : List Char -> Format |