# Ideas to Inspire #1

**URL:** <https://talk.atomisystems.com/t/ideas-to-inspire-1/7811>\
**Category:** ActivePresenter\
**Created:** [September 20, 2023, 2:22pm UTC](https://talk.atomisystems.com/t/ideas-to-inspire-1/7811 "2023-09-20T14:22:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![gregs](https://talk.atomisystems.com/user_avatar/talk.atomisystems.com/gregs/32/6695_2.png) [@gregs](https://talk.atomisystems.com/u/gregs)\
**Post date:** [September 20, 2023, 2:22pm UTC](https://talk.atomisystems.com/t/ideas-to-inspire-1/7811/1 "2023-09-20T14:22:52Z")

</div>

Here is a small project with a relatively simple idea: Generate Random Letters  
I share with you the two lines of JavaScript needed to make this work

[Link to Project](https://activepresenter.online/course/view.php?id=2308)

I would love to hear about the different ways that you can think of to use random letter generation in your own projects. Please share them in the comments.

---

<div class="post-metadata">

**Author:** ![PhuongThuy\_Le](https://talk.atomisystems.com/user_avatar/talk.atomisystems.com/phuongthuy_le/32/6090_2.png) [@PhuongThuy\_Le](https://talk.atomisystems.com/u/PhuongThuy_Le)\
**Post date:** [September 21, 2023, 2:25am UTC](https://talk.atomisystems.com/t/ideas-to-inspire-1/7811/2 "2023-09-21T02:25:46Z")

</div>

Hi Greg,

Thank you for sharing your creative project idea and the JavaScript code for generating random letters.  
After reviewing your project, we see that instead of creating each state for each letter which takes time, you can use the function **`object.text('new text')`** to change letter **`prez.object('tile').text(String.fromCharCode(prez.variable('num') + 64));`**

In addition, your random number generation from 1 to 26 is not quite accurate (it can generate 0, and is not evenly distributed). So, you can fix it by referring to the suggestion here: [Generate random number between two numbers in JavaScript - Stack Overflow](https://stackoverflow.com/questions/4959975/generate-random-number-between-two-numbers-in-javascript)

Nice day,  
Thuy

---

<div class="post-metadata">

**Author:** ![gregs](https://talk.atomisystems.com/user_avatar/talk.atomisystems.com/gregs/32/6695_2.png) [@gregs](https://talk.atomisystems.com/u/gregs)\
**Post date:** [September 21, 2023, 3:06am UTC](https://talk.atomisystems.com/t/ideas-to-inspire-1/7811/3 "2023-09-21T03:06:29Z")

</div>

> [@PhuongThuy\_Le](#):
>
> your random number generation from 1 to 26 is not quite accurate (it can generate 0, and is not evenly distributed)

I am familiar with the Math.floor() method as well.  
I have often preferred the Math.ceil version as it always seemed to do the same thing without issue.  
As I was thinking more critically about this, however, it came to light that it is possible Math.random() could produce a perfect zero - in which case - the result would remain as zero. I must admit I had not considered this nor do I think I have had it happen but I do see now the better logic of using the Math.floor() method instead.

Using the idea regarding object.text(‘new text’) is one that I had not considered. Interesting approach to play with. Thank you.
