2

I wrote a simple code in Dr-Racket and it is not working. Here is the code:

(place-image (circle 5 "solid" "green")
             50 80
             (empty-scene 100 100))

I have selected the BSL language for compiling but it is giving me the following error:

place-image: this function is not defined

What is going wrong?

Alex Knauth
  • 8,133
  • 2
  • 16
  • 31
user590849
  • 11,655
  • 27
  • 84
  • 125

2 Answers2

7

If you're following with recent versions of Dr. Racket and "How to Design Programs, Second Edition", you should add the following to the top of your code:

(require 2htdp/image)

The end result would be the following:

#lang racket
(require 2htdp/image)

(place-image (circle 5 "solid" "green") 50 80 (empty-scene 100 100))
mokeefe
  • 456
  • 1
  • 4
  • 8
2

You should add the image teachpack.

Eli Barzilay
  • 29,301
  • 3
  • 67
  • 110