Computer Science Canada tilting box |
Author: | djlenny_3000 [ Tue Apr 20, 2004 6:33 pm ] |
Post subject: | tilting box |
% The "tiltbox" program % The square box of length size is tilted so that its bottom % makes an angle theta degrees with x-axis % The upper left corner of the box is at the center var angle : real put "Enter angle of tilt in degrees " .. get angle var size : int put "Enter size of square box in pixels " .. get size var col:int put "Enter colour " .. get col % Draw box const xcenter := maxx div 2 const ycenter := maxy div 2 const c := cosd (angle) const s := sind (angle) const x1 := xcenter const y1 := ycenter const x2 := x1 + round (size * c) const y2 := y1 - round (size * s) const x3 := x2 + round (size * s) const y3 := y2 + round (size * c) const x4 := x1 + round (size * s) const y4 := y1 + round (size * c) drawline (x1, y1, x2, y2, col) drawline (x2, y2, x3, y3, col) drawline (x3, y3, x4, y4, col) drawline (x4, y4, x1, y1, col) please put comments BTW did i mension that this is my first time using sin and cos DAMN GRADE 11 MATH IS HARD WHEN IN GRADE 9 |
Author: | Catalyst [ Tue Apr 20, 2004 6:37 pm ] |
Post subject: | |
sin and cos are gr10 |
Author: | djlenny_3000 [ Tue Apr 20, 2004 6:38 pm ] |
Post subject: | |
sorry *said in VERY sarcasmic tone* in our school i believe we r doing it in grd 11 but if its ten then my fault |
Author: | Paul [ Tue Apr 20, 2004 6:41 pm ] | ||
Post subject: | |||
Hm... its cool, I don't understand it, and won't unless I look at it really carefully. Damn grade 10 math is hard when in grade 10 (not really lol) Check out this wacky effect using ur program, thanx !:
|
Author: | the_short1 [ Fri Apr 23, 2004 5:01 pm ] | ||
Post subject: | |||
cool looking paul... i will add that to compilation of visuals,,, anyways... this is a nice rendition of the question to draw a tilted box... GOOD JOB!!!! for mien i just used text...
hehehehehhe i cheated... but o well... |
Author: | Paul [ Fri Apr 23, 2004 8:58 pm ] |
Post subject: | |
short, the one u posted doesn't do anything. |
Author: | the_short1 [ Sun Apr 25, 2004 6:51 pm ] |
Post subject: | |
oopz.... colorback (black) for a : 1.. 15 locate (a,a) put " ".. end for forgot the .. and forgot to make ROW change too.... now it works.. |
Author: | djlenny_3000 [ Tue Apr 27, 2004 6:45 pm ] |
Post subject: | |
hey paul b. that's actually pretty cool i like the visual effect with the randow colors then outlines, did something like that once got 100% (but it was worth like 0.00000000000001% overall.) neways really nice i'd give bits but the weird thing is the fact that I DONT GOT NONE CMON 31 BITS ARRGH BTW out of pure boredom then i saw da loch ness monsta and it says i want treefiftay What the crap is treefiftay tree dolla an fify cents |