Project Description
Small .Net library for drawing graphics and writing text, similar to Small Basic but aimed more at the "Sharp" languages C# and F#.

F# Turtle Example
open Library

do  GraphicsWindow.Show()    
    pencolor red
    repeat 10 (fun () -> rt 36; repeat 5 (fun () -> fd 54; rt 72))


C# Turtle Example
using Library;

class Program
{
    static void Main(string[] args)
    {
        GraphicsWindow.Show();      
        Turtle.PenName("Red");
        (1000).Times(i =>
        {
            Turtle.Forward(6);
            Turtle.Right(i * 7);
        });
    }
}


F# Pattern Example
open Library

do  GraphicsWindow.Show()
    GraphicsWindow.BrushColor <- red
    for i in 0..5..200 do
        GraphicsWindow.DrawLine(i,0,200-i,200)
        GraphicsWindow.DrawLine(0,i,200,200-i)


F# Smiley Example
open Library

do  GraphicsWindow.Show()
    GraphicsWindow.FillColor <- yellow
    GraphicsWindow.BrushColor <- black
    GraphicsWindow.BrushWidth <- 5.0
    GraphicsWindow.DrawEllipse(50.0,50.0,200.0,200.0)
    GraphicsWindow.DrawEllipse(90.0,90.0,120.0,120.0)
    GraphicsWindow.BrushWidth <- 0.0
    GraphicsWindow.DrawRectangle(90.0,90.0,120.0,60.0)
    GraphicsWindow.BrushWidth <- 10.0
    GraphicsWindow.DrawEllipse(90.0,100.0,10.0,10.0)
    GraphicsWindow.DrawEllipse(200.0,100.0,10.0,10.0)



F# FizzBuzz:

open Library

do  [1..100]
     .Map(fun n -> 
        match n%3,n%5 with 
        | 0,0 -> "FizzBuzz" 
        | 0,_ -> "Fizz" 
        | _,0 -> "Buzz" 
        | _,_ -> string n)
     .Iter(printfn "%s")


Build
Appveyor:

Last edited Aug 15, 2015 at 11:25 AM by ptrelford, version 10