# 🗃 U5LA1 Mini Project: Custom Function Library

### Prompt

**So you’ve written a function - what now?**

Writing functions are not just helpful for you to be able to use your code many times, but you can also share your functions and they can be used by other people! As long as your function is defined in someone else’s code, they can call your function and use it to create their own custom art.

To that end, you will be creating a new design and turning it into a function. You will then share the design with your class on a platform chosen by your teacher. You will choose several of your classmate’s functions to use in a project to create your own unique art!

**Your project should have and do the following:**

* Include at least three other function definitions written by your peers&#x20;
* Call each of the functions written by your peers at least once&#x20;
* Include some sort of interactivity using a conditional statement&#x20;
* Include one for loop that draws a function repeatedly

#### **Writing Prompt:**

Explain how the sharing of functions can be useful in a development community. Beyond just art, how could this be helpful?

### Extensions

* Time to get organized - ask your teacher how to create a separate functions.js file and link it through your HTML to keep your code neat and readable.&#x20;
* Create a second function and see if you can call other functions inside of that function&#x20;
* Include conditionals in your custom function to control your design - have different designs display when different actions are completed

**NOTE: LINKING SEPARATE JS FILES**

There are a few ways to go about getting multiple javascript files to talk to each other in one project. The easiest way with what students know right now is to do the following:

1. Create a separate **functions.js** file
2. In your **index.html,** add a line above \<script src="sketch.js">\</script> that says \<script src="functions.js">\</script>
3. You should be linked! Test by using a function from functions.js in your sketch and see if it works!


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://cs4all-icm.gitbook.io/introduction-to-computational-media-curriculum/unit-5-functions-and-abstraction/u5la1-mini-project-custom-function-library.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
