Skip to content

Instantly share code, notes, and snippets.

mem-memov

Block or report user

Report or block mem-memov

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@mem-memov
mem-memov / semantic_javascript
Last active Aug 22, 2018
Semantic JavaScript is a new way of inteacting in the web. In this simple example two men give information about birds using cybe language. Semantic graph is created authomatically. The machine asks the second man questions about birds.
View semantic_javascript
var ai = (function() {
var ai = {
phrases: {},
phraseIds: {},
nextPhraseId: 1,
authors: {},
authorIds: {},
@mem-memov
mem-memov / starman.hs
Created Sep 18, 2019
guess dog or cat
View starman.hs
import System.Random
starman :: Int -> IO ()
starman n = do
let allWords = ["cat", "dog"]
index <- randomRIO(0, (length allWords) - 1)
let word = allWords !! index
turn word ['-' | x <- word] n
turn :: String -> String -> Int -> IO ()
View gist:ec9f94c0e475f9d03713cc6b81a85763
let fltr = f :: (a -> Bool) -> [a] -> [a] where f _ [] = []; f p (x:xs) = if (p x) then x:(f p xs) else f p xs in fltr (<5) [2,44,1,32]
View insertInOrder
insertInOrder :: Int -> Tree -> Tree
insertInOrder x Leaf = Node x Leaf Leaf
insertInOrder x node@(Node y _ _)
| x == y = node
insertInOrder x (Node y left@(Node ly _ _) Leaf)
| x > ly && x < y = Node x left Leaf
| x < ly = Node y (insertInOrder x left) Leaf
| x > y = Node y left (insertInOrder x Leaf)
insertInOrder x (Node y Leaf right@(Node ry _ _))
| x > y && x < ry = Node x Leaf right
You can’t perform that action at this time.