# Programming Question

**URL:** <https://forum.electromage.com/t/programming-question/1852>\
**Category:** Patterns and Code\
**Created:** [December 22, 2021, 9:35pm UTC](https://forum.electromage.com/t/programming-question/1852 "2021-12-22T21:35:58Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![Scruffynerf](https://forum.electromage.com/letter_avatar_proxy/v4/letter/s/34f0e0/32.png) [@Scruffynerf](https://forum.electromage.com/u/Scruffynerf)\
**Post date:** [December 23, 2021, 12:07am UTC](https://forum.electromage.com/t/programming-question/1852/7 "2021-12-23T00:07:58Z")

</div>

> [@Vitaliy](#):
>
> I tried to put the init() function anywhere but not at the end.  
> I will try this and see how this will work.

Bare code not inside a function just runs. On pattern start. Using @jeff 's init example is good practice though.

From personal experience, performance on 2D arrays can be very slow. You might want to make separate 1D arrays, if possible. Sometimes a frame buffer makes it easier, but sometimes it’s unneeded. For an example of frame buffer like behavior, see [Multimap multi-pattern](https://forum.electromage.com/t/multimap-multi-pattern-its-alive/1213)

---

_[View the full topic](https://forum.electromage.com/t/programming-question/1852)._
