Commit b00443c5 authored by Nicolas Lenz's avatar Nicolas Lenz

Some work on yeeting

parent d72590ff
......@@ -16,7 +16,15 @@ description: Please see the README at <https://git.eisfunke.com/software
dependencies:
- base
- text
- network
- bytestring
- connection
- JuicyPixels
default-extensions:
#- NoImplicitPrelude
- OverloadedStrings
#- LambdaCase
#- RecordWildCards
library:
source-dirs: src
......
module Main where
import qualified Data.ByteString as B
import qualified Data.Text as T
import qualified Data.Text.Encoding as T
import Text.Printf
import Network.Connection
import Codec.Picture
main :: IO ()
main = do
putStrLn "Hello World!"
ctx <- initConnectionContext
con <- connectTo ctx $ ConnectionParams
{ connectionHostname = "localhost"
, connectionPort = 1337
, connectionUseSecure = Nothing
, connectionUseSocks = Nothing
}
connectionPut con (T.encodeUtf8 "PX 20 20 ff0000\n")
connectionClose con
data Pixel = Pixel {
pixelX :: Int,
pixelY :: Int,
pixelColor :: PixelRGB8
}
yeet :: Connection -> Int -> Int -> PixelRGB8 -> IO ()
yeet con x y (PixelRGB8 r g b) = connectionPut con $ T.encodeUtf8
$ printf "PX %d %d %02x%02x%02x\n" x y r g b
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment