diff --git a/pkgs/plt-services/meta/new-web/www/img/cos-deriv.png b/pkgs/plt-services/meta/new-web/www/img/cos-deriv.png new file mode 100644 index 0000000000..6848aac4c4 Binary files /dev/null and b/pkgs/plt-services/meta/new-web/www/img/cos-deriv.png differ diff --git a/pkgs/plt-services/meta/new-web/www/img/sierp.png b/pkgs/plt-services/meta/new-web/www/img/sierp.png new file mode 100644 index 0000000000..beb70f02f3 Binary files /dev/null and b/pkgs/plt-services/meta/new-web/www/img/sierp.png differ diff --git a/pkgs/plt-services/meta/new-web/www/index.rkt b/pkgs/plt-services/meta/new-web/www/index.rkt index 8b139d9c1e..e243a7b4a5 100644 --- a/pkgs/plt-services/meta/new-web/www/index.rkt +++ b/pkgs/plt-services/meta/new-web/www/index.rkt @@ -114,11 +114,13 @@ [(zero? n) (triangle 2 'solid 'red)] [else (define t (sierpinski (- n 1))) (freeze (above t (beside t t)))]))} + (list @desc{The @elemcode{2htdp/image} library provides easy-to-use functions for constructing images, and DrRacket can display an image result as easily as it can display a number result. In this case, a @elemcode{sierpinski} function is defined and called (at the same time) - to generate a Sierpinski triangle of depth 8.}) + to generate a Sierpinski triangle of depth 8. It looks like} + @img[width: "50%" src: (copyfile #:site www-site (build-path img-dir "sierp.png"))])) (graphical-example #:title "GUI Programming"; --------------------------------------------- @code{#lang racket/gui ; A GUI guessing game (define f (new frame% [label "Guess"])) @@ -158,14 +160,19 @@ @code{#lang racket ;; Print the Greek alphabet (for ([i (in-range 25)]) - (displayln + (display (integer->char (+ i (char->integer #\α)))))} + (list + @span{This prints out: } + @|br| + @elemcode{αβγδεζηθικλμνξοπρςστυφχψω} + @|br| @desc{You can also spell @elemcode{#\α} as @elemcode{#\u3B1} to stay within ASCII. Fortunately, Racket and DrRacket are both perfectly happy to use Unicode characters, and DrRacket comes - with shortcuts for inserting them.}) + with shortcuts for inserting them.})) (graphical-example #:title "Functional Animations"; --------------------------------------------- @code{#lang htdp/bsl ; Any key inflates the balloon (require 2htdp/image) (require 2htdp/universe) @@ -218,9 +225,11 @@ (define (thrice f) (lambda (x) (f (f (f x))))) (plot (list (function ((thrice deriv) sin) -5 5) (function cos -5 5 #:color 'blue)))} + (list @desc{This program uses the @elemcode{plot} library to draw plots of - functions. Note that the plots are actual value, which DrRacket shows - in graphical form.}) + functions. Note that the plots are actual values, which DrRacket shows + in graphical form. It looks like} + @img[width: "50%" src: (copyfile #:site www-site (build-path img-dir "cos-deriv.png"))])) (generic-example #:title "Sending email"; ----------------------------------------------- @code{#lang racket ; Sending email from racket (require net/sendmail)