Skip to content

Commit edc49f6

Browse files
committed
Adds more programs.
Adds .gitignore to eleminiate noise in git status
1 parent 3fbecf4 commit edc49f6

File tree

3 files changed

+55
-0
lines changed

3 files changed

+55
-0
lines changed

.gitignore

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
*.c
2+
*.gcn
3+
*.gso
4+
*.gso.dSYM
5+
*.gso.dSYM/*
6+
*.js
7+
*.gct
+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
dialect "minitest"
2+
3+
testSuite {
4+
def l = list [1, 3, 5, 2, 4]
5+
6+
test "list is mutated by add" by {
7+
l.add 6
8+
assert (l.size) shouldBe (6)
9+
}
10+
11+
test "list unchanged in separate test" by {
12+
assert (l.size) shouldBe (5)
13+
}
14+
}
15+
16+
testSuiteNamed "set tests" with {
17+
def s = set [1, 3, 5, 2, 4]
18+
19+
test "set is mutated by add" by {
20+
s.add(6)
21+
assert (s.size) shouldBe (6)
22+
}
23+
24+
test "set does not contain duplicates" by {
25+
s.add(1)
26+
s.add(2)
27+
assert (s.size) shouldBe (5)
28+
}
29+
}

objectdrawPrograms/raisingSun.grace

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
dialect "objectdraw"
2+
3+
object {
4+
inherits graphicApplicationSize (200@200)
5+
6+
// Circle representing the sun
7+
def sun = filledOvalAt (50 @ 20) size (50 @ 50) on (canvas)
8+
sun.color := color.yellow
9+
10+
// Display instructions
11+
textAt (20 @ 20) with ("Drag the mouse up or down") on (canvas)
12+
13+
// Drag to raise or lower the sun
14+
method onMouseDrag (mousePosition: Point) -> Done {
15+
sun.moveTo (50 @ mousePosition.y)
16+
}
17+
18+
startGraphics
19+
}

0 commit comments

Comments
 (0)