// // Title: Concepts of Programming Languages // Number: CAS CS 320 // Semester: Fall 2012 // Class Time: TR 12:30-2:00 // Instructor: Hongwei Xi (hwxiATcsDOTbuDOTedu) // Teaching Fellow: Alex Ren (arenATcsDOTbuDOTedu) // (* // // Assignment #3 // Due Friday, February 8, 2013 at 11:59pm // Total points: 30 // *) (* ****** ****** *) // // Problem 1: 30 points // (* ****** ****** *) abstype point_type typedef point = point_type (* ****** ****** *) fun point_make (x: double, y: double): point fun point_get_x (p: point): double fun point_get_y (p: point): double (* ****** ****** *) abstype color_type typedef color = color_type fun color_make (r: double, g: double, b: double): color fun color_get_r (clr: color): double fun color_get_g (clr: color): double fun color_get_b (clr: color): double (* ****** ****** *) // // HX: // this function will be provided to you later. // It draws a triangle whose 3 vertices are located // at [p1], [p2], and [p3] and then paints the inside // of the triangle with the given color [clr] // fun draw4 ( p1: point, p2: point, p3: point, p4: point, clr: color ) : void // end of [draw4] (* ****** ****** *) typedef tower = array0 (int) fun draw4_tower ( p1: point, p2: point, p3: point, p4: point, clr: color, twr: tower ) : void // end of [draw4_tower] (* ****** ****** *) (* end of [assignment3_draw.sats] *)