Skip to content

Instantly share code, notes, and snippets.

View lgastako's full-sized avatar

John lgastako

  • Francon & Heyer
  • Milky Way Galaxy, Third Rock from the Sun
View GitHub Profile
from typing import Any
from functools import partial
import logging as log
import os
import re
import subprocess
from autobot.funcs.base import Fn
from autobot.funcs.helpers import canonicalize_path
from abc import ABC, abstractmethod
class Fn(ABC):
def __init__(self,
name,
description,
params,
required=None):
self.name = name
self.description = description
Prompt
Please write me a classic Snake game in a single page HTML document with the CSS and JS inline.
ChatGPT
Here's a simple classic Snake game using HTML, CSS, and JavaScript, all within a single HTML file. Just copy and paste the code below into a new HTML file, then open it in your web browser to play the game.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Builtins
import json
import os
import sys
import time
# Local
@lgastako
lgastako / LambdaFizzBuzz.py
Last active July 11, 2023 13:30
Finally figured out how to write fizzbuzz in python
ADD = lambda a: lambda b: \
lambda f: lambda x: b(f)(a(f)(x))
MULT = lambda a: lambda b: \
lambda f: lambda x: a(b(f))(x)
ZERO = lambda f: lambda x: x
ONE = lambda f: lambda x: f(x)
TWO = ADD(ONE)(ONE)
THREE = ADD(ONE)(TWO)
FOUR = ADD(TWO)(TWO)
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE MultiWayIf #-}
{-# LANGUAGE OverloadedLabels #-}
module Example where
import GHC.Generics ( Generic )
import Control.Lens ( (+=)
, (*=)
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE TypeApplications #-}
module Biplate where
import Control.Lens
import Data.Data
import Data.Data.Lens
data B = C | D | E
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE TypeApplications #-}
module Biplate where
import Control.Lens
import Data.Data
import Data.Data.Lens
data B = C | D | E
{-# LANGUAGE DeriveDataTypeable #-}
module Biplate where
import Control.Lens
import Data.Data
import Data.Data.Lens
newtype X a = X a
deriving (Data, Show)
{-# LANGUAGE OverloadedStrings #-}
module GetIn where
import Prelude hiding ( lookup )
import Control.Monad ( (<=<)
, join
)
import Data.Aeson ( Value( Array