View Quad.hs
import Data.Maybe (catMaybes)
import qualified Data.Set as Set
(|>) = flip ($)
between :: Ord a => a -> (a, a) -> Bool
between x (a, b) = a <= x && x <= b
class Clamp a where
clampedBy :: a -> (a, a) -> a
View Snake.hs
import Control.Monad (guard, when)
import Data.Array (Array, (!), (//), bounds, listArray)
import System.Console.ANSI
import System.IO (stdin, hReady)
import System.Random
import System.Timeout (timeout)
import Debug.Trace
data Pos
= Pos
View EventDescriptionValidity.java
package com.company;
import java.util.Optional;
import java.util.function.Function;
class Validity { }
class Valid extends Validity { }
View CombinedSchema.hs
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeApplications #-}
View Reversi.hs
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeFamilies #-}
import Control.Arrow
import Control.Monad
import Data.Array
import Data.Function
import Data.List
import Data.Maybe
import System.Environment
View HM.hs
{-# LANGUAGE TupleSections #-}
import Control.Monad.State (State, evalState, get, gets, modify, put)
import Data.Function (on)
import Data.List (unionBy)
import Data.Map (Map)
import Data.Maybe (fromMaybe)
import qualified Data.Map as Map
View fireworks.html
<!DOCTYPE html>
<html>
<head>
<title>Fireworks</title>
</head>
<body>
<script>
const SCRW = 800;
const SCRH = 800;
View fibo.py
class Vec2(object):
def __init__(self, x, y):
self.x = x
self.y = y
def dot(v, w):
return v.x * w.x + v.y * w.y
class Mat22(object):
def __init__(self, a, b, c, d):
View ondulator.html
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Ondulator</title>
<script>
const PI = Math.PI;
const TAU = 2 * PI;
View Fruits.hs
import Data.SBV
fruits :: SInteger -> SInteger -> SInteger -> SBool
fruits a b c = equation &&& positive
where
x = sFromIntegral a :: SReal
y = sFromIntegral b :: SReal
z = sFromIntegral c :: SReal
equation = x / (y + z) + y / (x + z) + z / (x + y) .== 4