Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Source 

[Racket] Interactive Slideshow Maker Wizard

I used to have a bunch of custom hotbars filled with interactive code & media generators, I've lost most of it until I gain the mental strength to go through my old unsorted harddrives.
Luckily I managed to dig up this small section I'd linked to a friend on Facebook.

Written in DrRacket's built-in slideshow lang, syntactically it's still just Racket/Plt-Scheme.

Code
#lang slideshow

(define (readstring) (let ((inp (read)))

                              (if (string? inp) inp

                              (if (symbol? inp) (symbol->string inp)

                              (if (number? inp) (number->string inp)

                                  inp

                                  )))))



(define (getitems) (begin

                     (display "please enter item text, in speech marks if it contains spaces, or :n for next slide \n")

                     (let ((instring (readstring)))

                      (if (equal? instring ":n")                

                     '()

                     (cons instring (getitems))

                     ))))

(define (makeslideshow)

(begin

  (display "Please enter slide title, with speech marks if it contains spaces, \" \" for no title, or :q to quit.")

  (let ((title (readstring)))

    (if (equal? title ":q")

        ""

    (let ((items (getitems)))

     (string-append "(slide

     #:title \"" title "\"" (apply string-append (map (lambda (x) (string-append "(item \"" x "\")")) items)) ")

" (makeslideshow) ))))))



(display (makeslideshow))
[Image: zzzscreen.gif]


Possibly Related Threads...
Thread / Author Replies Views Last Post
[Source] by MiguelSanchezMar 5, 2022 11:14 AM 0 89 Mar 5, 2022 11:14 AM
Last Post: MiguelSanchez
[Help] by Caleb™Dec 3, 2016 07:45 AM 3 183 Dec 3, 2016 07:45 AM
Last Post: r0gue
[Help] by clemmeJun 14, 2016 09:56 PM 4 100 Jun 14, 2016 09:56 PM
Last Post: Ashish Bisht