Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Modify the code to design a function called param_house(width, height, roof_height, door_height, door_width, color ); but with more parameters to generate a variety of

1. Modify the code to design a function called param_house(width, height, roof_height, door_height, door_width, color ); but with more parameters to generate a variety of houses. 2. Using random number generators, create houses of varying characteristics to create a whole town. Make small distant houses. Vary the colors of the houses by using the random number generator for colors. Make street-like patterns. See any problems? Have any solutions? Insight into problems may be more useful than immediate solution #include  void init(); void deinit(); int main() { init(); //while (!key[KEY_ESC]) { int roof[] = { 200,250, 600, 250, 550, 230, 250, 230 }; // x,y vertices /* put your code here */ clear_to_color(screen, makecol(0, 0, 255)); // blue sky rectfill(screen, 0, 599, 799, 200, makecol(0, 255, 0)); // green lawn rectfill(screen, 200, 250, 600, 400, makecol(157, 61, 62)); // house-box polygon(screen, 4, roof, makecol(86, 92, 91)); // house roof (trapezoid) rectfill(screen, 375, 400, 425, 325, makecol(86, 87, 82)); // door circlefill(screen, 410, 360, 6, makecol(150, 145, 50)); // knob on door rectfill(screen, 250, 375, 350, 300, makecol(224, 171, 95)); // left window rectfill(screen, 550, 375, 450, 300, makecol(244, 195, 85)); // right window rectfill(screen, 300, 230, 330, 210, makecol(95, 136, 118));//chimney } system("pause"); deinit(); return 0; } END_OF_MAIN() void init() { int depth, res; allegro_init(); depth = desktop_color_depth(); if (depth == 0) depth = 32; set_color_depth(depth); res = set_gfx_mode(GFX_AUTODETECT_WINDOWED, 800, 600, 0, 0); if (res != 0) { allegro_message(allegro_error); exit(-1); } install_timer(); install_keyboard(); install_mouse(); /* add other initializations here */ } void deinit() { clear_keybuf(); /* add other deinitializations here */ }

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Access Patterns Database Interactions In Object Oriented Applications

Authors: Clifton Nock

1st Edition

0321555627, 978-0321555625

More Books

Students also viewed these Databases questions

Question

2. What are your challenges in the creative process?

Answered: 1 week ago