SlideShare a Scribd company logo
Generative Art
Phillip Trelford
F#unctional Londoners
2013
Generative Art: Que?
Generative artists are chaos artists
…embrace the chaos & learn to love it
Modern Art: Procedurally Generated
Modern Art: Animated
Animated Gifs
Happy endings
// Generate text from Philippe Decrauzat's D.T.A.B.T.W.H.A.H.E. 2010
let print (s:string) =
[|for y in 0..s.Length-1 ->
[|for x in 0..y-1 -> s.[x]
for x in y..s.Length-1 -> s.[y]
|]
|> fun cs ->
System.String(cs) +
System.String(cs |> Array.rev |> Seq.skip 1 |> Seq.toArray)
|]
|> fun ys -> [|yield! ys; yield! (Array.rev ys |> Seq.skip 1)|]
|> String.concat "rn"
print "A HAPPY ENDING"
Choose your own adventure
SmallSharp: Lines
open Library
do GraphicsWindow.Show()
GraphicsWindow.BrushColor <- red
for i in 0..5..200 do
GraphicsWindow.DrawLine(i,0,n-i,n)
GraphicsWindow.DrawLine(0,i,n,n-i)
Deviant Art: Bubbles
Rothko / Async Rectangles
let rec waiting() = async {
let! md = Async.AwaitObservable(main.MouseLeftButtonDown)
let rc = new Canvas(Background = transparentGray)
main.Children.Add(rc)
do! drawing(rc, md.GetPosition(main)) }
and drawing(rc:Canvas, pos) = async {
let! evt = Async.AwaitObservable(main.MouseLeftButtonUp, main.MouseMove)
match evt with
| Choice1Of2(up) ->
rc.Background <- SolidColorBrush(colorSelect.CurrentColor)
do! waiting()
| Choice2Of2(move) ->
moveControl rc pos (move.GetPosition(main))
do! drawing(rc, pos) }
Mandelbrot
let (|Escaped|DidNotEscape|) (cx,cy) =
let rec compute (zx,zy) i =
if i = maxIteration then DidNotEscape
elif zx * zx + zy * zy > 4.0 then Escaped i
else compute (zx*zx - zy*zy + cx, 2.0*zx * zy + cy) (i+1)
compute (cx,cy) 0
Turing Drawings
match action with
| Action.Left ->
xPos <- xPos + 1
if xPos >= mapWidth then xPos <- xPos - mapWidth
| Action.Right ->
xPos <- xPos - 1
if (xPos < 0) then xPos <- xPos + mapWidth
| Action.Up ->
yPos <- yPos - 1
if (yPos < 0) then yPos <- yPos + mapHeight
| Action.Down ->
yPos <- yPos + 1
if yPos >= mapHeight then yPos <- yPos - mapHeight
Inspirational Sites
This is Colossal Deviant Art Zen Bullets
F# Libraries
http://smallsharp.codeplex.com (Graphics)
http://funscript.info (F# -> JS)
http://www.pinksquirrellabs.com (CYAO Type Provider)

More Related Content

PPTX
Matlab introduction
PPTX
Ready, steady, cross platform games - ProgNet 2015
PDF
Congreso nacional-morena
PPTX
.NET? MonoDroid Does
PPT
Road to Success (July 1st) - Mobile Game Development Alternatives - Andrew Bu...
PDF
Madrid .NET Meetup: Microsoft open sources .NET!
PPTX
Flappy - Paris 2015
PPTX
Xna and mono game
Matlab introduction
Ready, steady, cross platform games - ProgNet 2015
Congreso nacional-morena
.NET? MonoDroid Does
Road to Success (July 1st) - Mobile Game Development Alternatives - Andrew Bu...
Madrid .NET Meetup: Microsoft open sources .NET!
Flappy - Paris 2015
Xna and mono game

Viewers also liked (18)

PPTX
CocosSharp_XHackNight_07feb
PPTX
Cross platform physics games - NDC 2014
PPTX
EastBay.NET - Introduction to MonoTouch
PDF
Multyplatform and mono part 2 - Matteo Nicolotti
PPTX
Cross-platform Game Dev w/ CocosSharp
PDF
Games with Win 8 Style by Neneng
PDF
Introduction to CocosSharp
PDF
Gaming in Csharp
PPTX
Generative Art - Functional Vilnius 2015
PDF
Monogame and xna
PDF
Intro to Gaming- MonoGame/CocosSharp/UrhoSharp
PPTX
Flappy bird game in c#
PDF
Tips & Tricks that every game developer should know
PPTX
Building a game in a day
PPTX
Mobile F#un
PPTX
UniteKorea2014 - Making flappy bird workshop
PPTX
Smyowl - desenvolvimento games win8
PPTX
Desenvolvendo Jogos 2D em HTML5 - Cocos2d-x
CocosSharp_XHackNight_07feb
Cross platform physics games - NDC 2014
EastBay.NET - Introduction to MonoTouch
Multyplatform and mono part 2 - Matteo Nicolotti
Cross-platform Game Dev w/ CocosSharp
Games with Win 8 Style by Neneng
Introduction to CocosSharp
Gaming in Csharp
Generative Art - Functional Vilnius 2015
Monogame and xna
Intro to Gaming- MonoGame/CocosSharp/UrhoSharp
Flappy bird game in c#
Tips & Tricks that every game developer should know
Building a game in a day
Mobile F#un
UniteKorea2014 - Making flappy bird workshop
Smyowl - desenvolvimento games win8
Desenvolvendo Jogos 2D em HTML5 - Cocos2d-x
Ad

More from Phillip Trelford (20)

PPTX
How to be a rock star developer
PPTX
F# eXchange Keynote 2016
PPTX
FSharp eye for the Haskell guy - London 2015
PPTX
Beyond lists - Copenhagen 2015
PPTX
F# for C# devs - Copenhagen .Net 2015
PPTX
24 hours later - FSharp Gotham 2015
PPTX
Building cross platform games with Xamarin - Birmingham 2015
PPTX
Beyond Lists - Functional Kats Conf Dublin 2015
PPTX
FSharp On The Desktop - Birmingham FP 2015
PPTX
F# for C# devs - NDC Oslo 2015
PPTX
F# for C# devs - Leeds Sharp 2015
PPTX
Build a compiler in 2hrs - NCrafts Paris 2015
PPTX
24 Hours Later - NCrafts Paris 2015
PPTX
Real World F# - SDD 2015
PPTX
F# for C# devs - SDD 2015
PPTX
Machine learning from disaster - GL.Net 2015
PPTX
F# for Trading - QuantLabs 2014
PPTX
Write Your Own Compiler in 24 Hours
PPTX
FParsec Hands On - F#unctional Londoners 2014
PPTX
F# in your pipe
How to be a rock star developer
F# eXchange Keynote 2016
FSharp eye for the Haskell guy - London 2015
Beyond lists - Copenhagen 2015
F# for C# devs - Copenhagen .Net 2015
24 hours later - FSharp Gotham 2015
Building cross platform games with Xamarin - Birmingham 2015
Beyond Lists - Functional Kats Conf Dublin 2015
FSharp On The Desktop - Birmingham FP 2015
F# for C# devs - NDC Oslo 2015
F# for C# devs - Leeds Sharp 2015
Build a compiler in 2hrs - NCrafts Paris 2015
24 Hours Later - NCrafts Paris 2015
Real World F# - SDD 2015
F# for C# devs - SDD 2015
Machine learning from disaster - GL.Net 2015
F# for Trading - QuantLabs 2014
Write Your Own Compiler in 24 Hours
FParsec Hands On - F#unctional Londoners 2014
F# in your pipe
Ad

Recently uploaded (20)

PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Machine learning based COVID-19 study performance prediction
PDF
cuic standard and advanced reporting.pdf
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PPTX
Cloud computing and distributed systems.
PDF
Empathic Computing: Creating Shared Understanding
PDF
Electronic commerce courselecture one. Pdf
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PDF
Modernizing your data center with Dell and AMD
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Unlocking AI with Model Context Protocol (MCP)
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
Encapsulation_ Review paper, used for researhc scholars
Reach Out and Touch Someone: Haptics and Empathic Computing
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Machine learning based COVID-19 study performance prediction
cuic standard and advanced reporting.pdf
Review of recent advances in non-invasive hemoglobin estimation
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
“AI and Expert System Decision Support & Business Intelligence Systems”
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Chapter 3 Spatial Domain Image Processing.pdf
Cloud computing and distributed systems.
Empathic Computing: Creating Shared Understanding
Electronic commerce courselecture one. Pdf
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Modernizing your data center with Dell and AMD
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Unlocking AI with Model Context Protocol (MCP)
Digital-Transformation-Roadmap-for-Companies.pptx

Generative Art Hands On with F#

Editor's Notes

  • #2: Bookshttp://zenbullets.com/book.phpSiteshttp://www.deviantart.com/digitalart/fractals/?order=67108864http://www.thisiscolossal.com/category/art/Toolshttps://smallsharp.codeplex.com/http://tsunami.io/http://tsunami.io/cloud_tsunami.htmlhttp://funscript.info/samples/mandelbrot.html
  • #10: http://basil4life.deviantart.com/art/Colorful-Bubbles-393039067