# Game issues for christmas

**URL:** <https://discourse.processing.org/t/game-issues-for-christmas/14780>\
**Category:** Coding Questions\
**Created:** [October 18, 2019, 3:30pm UTC](https://discourse.processing.org/t/game-issues-for-christmas/14780 "2019-10-18T15:30:40Z")\
**Posts on this page:** 1\
**Showing post:** 61

<div class="post-metadata">

**Author:** ![kll](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kll/32/964_2.png) [@kll](https://discourse.processing.org/u/kll)\
**Post date:** [October 22, 2019, 1:27am UTC](https://discourse.processing.org/t/game-issues-for-christmas/14780/61 "2019-10-22T01:27:20Z")

</div>

> [@Mike](#):
>
> i saved your examples

i did not see this for the quiz game state system and the qa.csv file idea  
i prepared for you.

* * *

> [@Mike](#):
>
> modularize my program using some file.js

more details please?

again, like the idea that the questions and answers should not be “hard coded”  
( better already is to use suggested arrays )  
instead treat it as DATA  
from a loadable external file ( here spreadsheet type qa.csv )  
to a table object.

so yes, modularization can be ( in a second step ) to separate code to several files.  
but: the reason can not be that your code is now 3000 lines.  
as in times of code folding here p5.js online editor  
 ![p5js_codefolding](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/2/23b620637bddc0a36ab1699cf406f42c8b2d7448.png)  
it is again your problem about (re)-using more own logical functions  
just copy 1000 lines outside to a external file actually makes it more difficult to find something.

no, the real reason for using a extra code file should be re usability.  
so you have a function /  
or a class ( for what it is the pure reason they exist: to be re used )  
you want use from several projects you could  
download and upload that as a extra file.js.  
But to get that running need to declare it in the index.html  
( or your browser would not know that it must download it )

to show that better i made a little play code

> **[p5.js Web Editor](https://editor.p5js.org/kll/sketches/t1gPyCfoR)**
>
> A web editor for p5.js, a JavaScript library with the goal of making coding accessible to artists, designers, educators, and beginners.

 ![js](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/0/0c6a6ed83b1c08460ccf980bcf612259b9990b25.png)

---

_[View the full topic](https://discourse.processing.org/t/game-issues-for-christmas/14780)._
