# U3L8 - Bubble 12

**URL:** <https://forum.code.org/t/u3l8-bubble-12/31903>\
**Category:** CS Principles\
**Tags:** csp-unit-3-lesson-8\
**Created:** [December 11, 2019, 8:54pm UTC](https://forum.code.org/t/u3l8-bubble-12/31903 "2019-12-11T20:54:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![cditzel1](https://avatars.discourse-cdn.com/v4/letter/c/c57346/32.png) [@cditzel1](https://forum.code.org/u/cditzel1)\
**Post date:** [December 11, 2019, 8:54pm UTC](https://forum.code.org/t/u3l8-bubble-12/31903/1 "2019-12-11T20:54:20Z")

</div>

I’ve spent hours on this code with a student (and on my own). Error says it’s at line 72 “parameter value for r, g, b” undefined.

I’m very new to this and need more help - I basically understand that line 72 doesn’t understand what the r,g,b values are – but I thought they were declared on line 24.

Thank you!

// Prepare Turtle to Draw  
hide();  
penUp();

// First draw the background  
drawBackground();

moveTo(150,400);  
// draw all the starfish  
drawStarfish(randomNumber(20, 60));  
moveTo(200,350);  
drawStarfish(randomNumber(30, 50));  
// Draw all the seagrass on bottom of screen  
moveTo(50,450);  
turnTo(0);  
drawSeagrass(50,90);  
moveTo(75,450);  
drawSeagrass(70,110);  
// Draw all the fish  
moveTo(100,100);  
drawFish(randomNumber(1, 20));  
moveTo(200,200);  
drawFish(randomNumber(1, 50), randomNumber(255), 0, randomNumber(200));

// Make the background by drawing a large dot  
function drawBackground(){  
penColor(“DarkBlue”);  
dot(1000);  
}

// Draw a five pointed star with a wide pen.  
function drawStarfish(size){  
// Setting up the pen  
penRGB(255,0,255);  
penWidth(20);  
penDown();

turnTo(0);  
moveForward(size);  
turnRight(144);  
moveForward(size);  
turnRight(144);  
moveForward(size);  
turnRight(144);  
moveForward(size);  
turnRight(144);  
moveForward(size);  
turnRight(144);  
penUp();  
}

// Switches between left and right arcs to make sea grass  
function drawSeagrass(radiusSize){  
// Setting up the pen  
penRGB(0,255,0);  
penWidth(10);  
penDown();

// Draw four arcs to make grass  
arcLeft(radiusSize,radiusSize);  
arcRight(radiusSize,radiusSize);  
arcLeft(radiusSize,radiusSize);  
arcRight(radiusSize,radiusSize);

penUp();  
}

// Draw a single fish at current turtle location  
function drawFish(size, red, green, blue){  
// Setting up the pen  
penRGB(red, green, blue);  
penWidth(size);  
penDown();

// Fish body  
dot(size);  
turnTo(90);  
moveForward(size);

// Fish tail  
turnLeft(30);  
moveForward(size);  
turnRight(120);  
moveForward(size);  
turnRight(120);  
moveForward(size);  
turnRight(120);

penUp();  
}

---

<div class="post-metadata">

**Author:** ![Mitch](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/mitch/32/2678_2.png) [@Mitch](https://forum.code.org/u/Mitch)\
**Post date:** [December 12, 2019, 12:04am UTC](https://forum.code.org/t/u3l8-bubble-12/31903/2 "2019-12-12T00:04:26Z")

</div>

Hi -

The problem is at line 21 :  
drawFish(randomNumber(1, 20));

The drawFish function requires 4 parameters but only 1 argument is being passed to the function.  
Try : drawFish(randomNumber(1, 20), 100,100,100);

- Mitch

---

<div class="post-metadata">

**Author:** ![infinitestasis](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/infinitestasis/32/5047_2.png) [@infinitestasis](https://forum.code.org/u/infinitestasis)\
**Post date:** [December 12, 2019, 9:50am UTC](https://forum.code.org/t/u3l8-bubble-12/31903/3 "2019-12-12T09:50:38Z")

</div>

Tell me what you are trying to accomplish. For now, [this solution](https://studio.code.org/projects/applab/8YMW54pvL1XNV7EScgmquUZqPzS8QVgwFIMESaOSjaA) will not change the pen color if it is not specified.
