-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
make sure translate only has one definition -- put-image
- Loading branch information
Showing
3 changed files
with
62 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
test-util/pyret-programs/modules/starter2024-on-essentials.arr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
use context essentials2021 | ||
|
||
import constants as C | ||
|
||
E = C.E | ||
shadow PI = C.PI | ||
|
||
sqrt = num-sqrt | ||
expt = num-expt | ||
sqr = num-sqr | ||
abs = num-abs | ||
dilate = scale | ||
shadow translate = put-image | ||
cos = num-cos | ||
sin = num-sin | ||
tan = num-tan | ||
negate = lam(x): -1 * x end | ||
|
||
img = text("Joe", 50, "purple") | ||
img2 = rectangle(1000, 200, "outline", "black") | ||
|
||
check: | ||
sqrt(1) is 1 | ||
expt(2, 3) is 8 | ||
sqr(2) is 4 | ||
abs(-7) is 7 | ||
dilate(2, img) is scale(2, img) | ||
translate(img, 100, 200, img2) is put-image(img, 100, 200, img2) | ||
cos(0) is 1 | ||
sin(0) is 0 | ||
tan(0) is 0 | ||
negate(-8) is 8 | ||
cos(PI) is-roughly ~-1 | ||
sin(PI / 2) is-roughly ~1 | ||
num-exp(1) is-roughly E | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
use context starter2024 | ||
|
||
img = text("Joe", 50, "purple") | ||
img2 = rectangle(1000, 200, "outline", "black") | ||
|
||
check: | ||
sqrt(1) is 1 | ||
expt(2, 3) is 8 | ||
sqr(2) is 4 | ||
abs(-7) is 7 | ||
dilate(2, img) is scale(2, img) | ||
translate(img, 100, 200, img2) is put-image(img, 100, 200, img2) | ||
cos(0) is 1 | ||
sin(0) is 0 | ||
tan(0) is 0 | ||
negate(-8) is 8 | ||
cos(PI) is-roughly ~-1 | ||
sin(PI / 2) is-roughly ~1 | ||
num-exp(1) is-roughly E | ||
end |