home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Garbo
/
Garbo.cdr
/
mac
/
hypercrd
/
hc1_2_x
/
studymth.sit
/
StudyMath
/
card_2817.txt
< prev
next >
Wrap
Text File
|
1990-05-07
|
18KB
|
823 lines
-- card: 2817 from stack: in
-- bmap block id: 3760
-- flags: 0000
-- background id: 2805
-- name:
----- HyperTalk script -----
on complexity operation, operator, n1, n2, n3, n4, checkNeg
global negative
send mouseUp to btn operation
send mouseUp to btn operator
global number, digits, brackets, negative, decimal
put n1 into number
put n1 into cd fld "number"
put n2 into digits
put n2 into cd fld "digits"
put n3 into brackets
put n3 into cd fld "brackets"
put n4 into decimal
put n4 into cd fld "decimal"
if checkNeg then
set hilite of btn "Negative" to true
put true into negative
else
set hilite of btn "Negative" to false
put false into negative
end if
end complexity
function doOther
ShowDialog 2,200,"","","","",1,1
get the result
return it
end doOther
on GetNumber limit
get PopUp ("©1988SDrazga",220,rect of the target,x)
if it is empty then exit GetNumber
put it into choice
if offset("Other", choice) > 0 then put doOther() into choice
if choice + 0 <= limit then exit GetNumber
put choice into the target
end GetNumber
-- part 1 (button)
-- low flags: 00
-- high flags: C006
-- rect: left=31 top=73 right=89 bottom=86
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Easy
----- HyperTalk script -----
on mouseUp
global degree
put 1 into degree
selectMe "Medium,hard,very hard"
complexity "single","subtraction",2,1,0,0,false
end mouseUp
-- part 2 (button)
-- low flags: 00
-- high flags: 8006
-- rect: left=93 top=73 right=90 bottom=167
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Medium
----- HyperTalk script -----
on mouseUp
global degree
put 2 into degree
selectMe "easy,hard,very hard"
complexity "single","division",3,2,0,0,false
end mouseUp
-- part 3 (button)
-- low flags: 00
-- high flags: 8006
-- rect: left=31 top=91 right=107 bottom=84
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Hard
----- HyperTalk script -----
on mouseUp
global degree
put 3 into degree
selectMe "easy,Medium,very hard"
complexity "mixture","multiplication",4,2,1,1,true
end mouseUp
-- part 4 (button)
-- low flags: 00
-- high flags: 8006
-- rect: left=93 top=91 right=107 bottom=176
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Very Hard
----- HyperTalk script -----
on mouseUp
global degree
put 4 into degree
selectMe "easy,Medium,hard"
complexity "mixture","division",6,3,3,2,true
end mouseUp
-- part 5 (button)
-- low flags: 00
-- high flags: C006
-- rect: left=237 top=71 right=93 bottom=337
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Single
----- HyperTalk script -----
on mouseUp
global operation
put 1 into operation
selectMe "mixture"
end mouseUp
-- part 6 (button)
-- low flags: 00
-- high flags: 8006
-- rect: left=355 top=71 right=93 bottom=455
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Mixture
----- HyperTalk script -----
on mouseUp
global operation
put 2 into operation
selectMe "single"
end mouseUp
-- part 7 (button)
-- low flags: 00
-- high flags: E006
-- rect: left=237 top=99 right=115 bottom=337
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 3
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Addition
----- HyperTalk script -----
on mouseUp
selectMe "Subtraction,multiplication,division"
global operator
put 1 into operator
end mouseUp
-- part 8 (button)
-- low flags: 00
-- high flags: A006
-- rect: left=355 top=99 right=115 bottom=455
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 3
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Subtraction
----- HyperTalk script -----
on mouseUp
selectMe "addition,multiplication,division"
global operator
put 2 into operator
end mouseUp
-- part 9 (button)
-- low flags: 00
-- high flags: A006
-- rect: left=237 top=117 right=134 bottom=348
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 3
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Multiplication
----- HyperTalk script -----
on mouseUp
selectMe "addition,Subtraction,division"
global operator
put 3 into operator
end mouseUp
-- part 10 (button)
-- low flags: 00
-- high flags: A006
-- rect: left=355 top=117 right=134 bottom=455
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 3
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Division
----- HyperTalk script -----
on mouseUp
selectMe "addition,Subtraction,multiplication"
global operator
put 4 into operator
end mouseUp
-- part 11 (button)
-- low flags: 00
-- high flags: A003
-- rect: left=269 top=243 right=296 bottom=342
-- title width / last selected line: 0
-- icon id / first selected line: 27056 / 27056
-- text alignment: 1
-- font id: 3
-- text size: 9
-- style flags: 0
-- line height: 12
-- part name: Do it!
----- HyperTalk script -----
on mouseUp
global operation, negative, expression
set cursor to busy
add 1 to cd fld total
put empty into cd fld comments
put empty into cd fld "PercRight"
put -1 into realAnswer
lock screen
if negative is true then
repeat until realAnswer is not "INF"
if operation=1 then
single
else
mixture
end if
put cd fld "real Answer" into realAnswer
end repeat
else
repeat until (realAnswer>=0 and realAnswer is not "INF")
if operation=1 then
single
else
mixture
end if
put cd fld "real Answer" into realAnswer
end repeat
end if
unlock screen
set the name of btn id 4 of cd 2 to "Clear All"
put expression && "=?" into cd fld question
select char 1 of cd fld "answer"
end mouseUp
on single
global operator, digits, number, OperString, decimal,expression
put random((10^digits)-1)/10^decimal into expression
repeat for (number-1)
set cursor to busy
put space & word operator of operString & space after expression
put random(10^digits-1)/10^decimal after expression
end repeat
put expression & return after cd fld 1 of cd 2
put "put" && expression && "into cd fld" && quote & "real answer" & quote into cd fld working
do cd fld working
put empty into cd fld "answer"
end single
on mixture
global operator,digits, number,brackets,OperString,decimal,expression
put random((10^digits)-1)/10^decimal into expression
repeat for (number-1)
put space & random((10^digits)-1)/10^decimal after expression
end repeat
put expression into tmpExpress
repeat for brackets
put random(number-1) into loc1
put random(number-loc1)+loc1 into loc2
if not (loc1=1 and loc2=number) then
put "(" before word loc1 of expression
put ")" after word loc2 of expression
end if
end repeat
repeat with i=1 to number
put "(" & word i of tmpExpress & ")" into tmpWord
if tmpWord is in expression then
get offset(tmpWord,expression)
if it<>0 then
put word i of tmpExpress into char it to it-1+length(tmpWord) of expression
end if
end if
end repeat
repeat with i=1 to (number-1)
put word random(operator) of OperString before word i+1 of expression
end repeat
put expression & return after cd fld 1 of cd 2
put "put" && expression && "into cd fld" && quote & "real answer" & quote into cd fld working
do cd fld working
put empty into cd fld "answer"
end mixture
-- part 12 (field)
-- low flags: 01
-- high flags: 0000
-- rect: left=49 top=160 right=209 bottom=367
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 3
-- text size: 14
-- style flags: 256
-- line height: 24
-- part name: Question
-- part 13 (field)
-- low flags: 02
-- high flags: 4000
-- rect: left=49 top=229 right=254 bottom=193
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 3
-- text size: 14
-- style flags: 256
-- line height: 24
-- part name: answer
----- HyperTalk script -----
on closeField
global accuracy
if abs(me-cd fld "real answer")<0.5*10^(-accuracy) then
put "Well Done!" into cd fld "Comments"
put "R " before last line of cd fld 1 of cd 2
add 1 to cd fld "right"
put (cd fld right)*100/(cd fld total) into cd fld PercRight
else
put empty into me
put "Sorry, please try again!" into cd fld "Comments"
put "W " before last line of cd fld 1 of cd 2
add 1 to cd fld "missed"
put (cd fld right)*100/(cd fld total) into cd fld PercRight
select char 1 of me
end if
end closeField
-- part 14 (field)
-- low flags: 01
-- high flags: 0004
-- rect: left=268 top=138 right=154 bottom=291
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 3
-- text size: 10
-- style flags: 256
-- line height: 13
-- part name: Number
----- HyperTalk script -----
on mouseDown
getNumber 1
global Number
put me into Number
end mouseDown
-- part 17 (field)
-- low flags: 80
-- high flags: 4000
-- rect: left=48 top=187 right=254 bottom=390
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 20
-- text size: 18
-- style flags: 0
-- line height: 24
-- part name: working
-- part 18 (button)
-- low flags: 00
-- high flags: A003
-- rect: left=38 top=296 right=323 bottom=160
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Show the Answer
----- HyperTalk script -----
on mouseUp
get cd fld "real answer"
set numberFormat to cd fld "Nformat"
put it+0 into cd fld "answer"
end mouseUp
-- part 19 (field)
-- low flags: 80
-- high flags: 4000
-- rect: left=193 top=229 right=253 bottom=320
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 65535
-- font id: 20
-- text size: 18
-- style flags: 0
-- line height: 24
-- part name: real Answer
-- part 20 (field)
-- low flags: 01
-- high flags: 0004
-- rect: left=327 top=138 right=154 bottom=349
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 3
-- text size: 10
-- style flags: 256
-- line height: 13
-- part name: digits
----- HyperTalk script -----
on mouseDown
getNumber 0
global digits
put me into digits
end mouseDown
-- part 27 (field)
-- low flags: 01
-- high flags: 0004
-- rect: left=397 top=139 right=156 bottom=418
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 3
-- text size: 10
-- style flags: 256
-- line height: 13
-- part name: Brackets
----- HyperTalk script -----
on mouseDown
getNumber -1
global Brackets
put me into Brackets
end mouseDown
-- part 28 (button)
-- low flags: 00
-- high flags: A005
-- rect: left=406 top=154 right=174 bottom=481
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 3
-- text size: 10
-- style flags: 0
-- line height: 13
-- part name: Negative
----- HyperTalk script -----
on mouseUp
global negative
if the hilite of me is true then put true into negative
else put false into negative
end mouseUp
-- part 29 (button)
-- low flags: 00
-- high flags: A003
-- rect: left=163 top=296 right=324 bottom=345
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Show Record of Exercises
----- HyperTalk script -----
on mouseUp
go to card id 2270
end mouseUp
-- part 32 (field)
-- low flags: 01
-- high flags: 0004
-- rect: left=462 top=138 right=155 bottom=482
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 3
-- text size: 10
-- style flags: 256
-- line height: 13
-- part name: Decimal
----- HyperTalk script -----
on mouseDown
getNumber -1
global decimal
put me into decimal
end mouseDown
-- part 33 (field)
-- low flags: 03
-- high flags: 0000
-- rect: left=427 top=204 right=224 bottom=463
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 3
-- text size: 10
-- style flags: 256
-- line height: 16
-- part name: total
-- part 34 (field)
-- low flags: 03
-- high flags: 0000
-- rect: left=427 top=225 right=245 bottom=463
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 3
-- text size: 10
-- style flags: 256
-- line height: 16
-- part name: right
-- part 35 (field)
-- low flags: 03
-- high flags: 0000
-- rect: left=427 top=245 right=265 bottom=463
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 3
-- text size: 10
-- style flags: 256
-- line height: 16
-- part name: missed
-- part 36 (field)
-- low flags: 03
-- high flags: 0000
-- rect: left=427 top=265 right=284 bottom=463
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 3
-- text size: 10
-- style flags: 256
-- line height: 16
-- part name: PercRight
-- part 37 (button)
-- low flags: 00
-- high flags: A003
-- rect: left=409 top=295 right=323 bottom=489
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Restart
----- HyperTalk script -----
on mouseUp
put 0 into cd fld "total"
put 0 into cd fld "right"
put 0 into cd fld "missed"
put 0 into cd fld "percRight"
end mouseUp
-- part 38 (field)
-- low flags: 03
-- high flags: 4000
-- rect: left=103 top=261 right=285 bottom=267
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 3
-- text size: 12
-- style flags: 0
-- line height: 18
-- part name: comments
-- part 39 (field)
-- low flags: 80
-- high flags: 4000
-- rect: left=105 top=217 right=229 bottom=216
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 3
-- text size: 9
-- style flags: 0
-- line height: 12
-- part name: Nformat
-- part 40 (button)
-- low flags: 00
-- high flags: A000
-- rect: left=97 top=206 right=218 bottom=109
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: *
----- HyperTalk script -----
on mouseUp
global accuracy
ask "Accurate up to X digits after decimal point?" with accuracy
put it into cd fld "accuracy"
put it into accuracy
if it is empty then
put "0.######" into cd fld Nformat
put 6 into accuracy
exit mouseUp
end if
put "0." into format
repeat for it
put "0" after format
end repeat
put format into cd fld "Nformat"
end mouseUp
-- part 41 (field)
-- low flags: 80
-- high flags: 4000
-- rect: left=216 top=217 right=230 bottom=239
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 3
-- text size: 9
-- style flags: 0
-- line height: 12
-- part name: Accuracy
-- part 42 (button)
-- low flags: 00
-- high flags: 2000
-- rect: left=344 top=284 right=323 bottom=395
-- title width / last selected line: 0
-- icon id / first selected line: 23078 / 23078
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: ?
----- HyperTalk script -----
on mouseUp
lock screen
go to cd id 4237
set the scroll of fld "study history" to 440
unlock screen with dissolve
end mouseUp
-- part 45 (button)
-- low flags: 00
-- high flags: 2000
-- rect: left=350 top=29 right=54 bottom=384
-- title width / last selected line: 0
-- icon id / first selected line: 19678 / 19678
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: About...
----- HyperTalk script -----
on mouseUp
lock screen
go to cd id 4237
set the scroll of fld "study history" to 0
unlock screen with dissolve
end mouseUp
-- part contents for card part 14
----- text -----
2
-- part contents for card part 12
----- text -----
9 + 8 =?
-- part contents for card part 17
----- text -----
put 9 + 8 into cd fld "real answer"
-- part contents for card part 19
----- text -----
17
-- part contents for card part 20
----- text -----
1
-- part contents for card part 27
----- text -----
0
-- part contents for card part 32
----- text -----
0
-- part contents for card part 33
----- text -----
0
-- part contents for card part 34
----- text -----
0
-- part contents for card part 35
----- text -----
0
-- part contents for card part 39
----- text -----
0.######
-- part contents for card part 36
----- text -----
0