# Starting out with logic ai

**URL:** <https://forum.kirupa.com/t/starting-out-with-logic-ai/64347>\
**Category:** programming\
**Created:** [September 15, 2004, 12:53pm UTC](https://forum.kirupa.com/t/starting-out-with-logic-ai/64347 "2004-09-15T12:53:46Z")\
**Posts on this page:** 2\
**Page:** 2

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 28, 2004, 11:01am UTC](https://forum.kirupa.com/t/starting-out-with-logic-ai/64347/21 "2004-09-28T11:01:19Z")

</div>

Ah i didn’t know u could do that, i thought u could only remove the first or last element of the array, i didn’t read it properly, that should work, thanks Marz!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 28, 2004, 11:40am UTC](https://forum.kirupa.com/t/starting-out-with-logic-ai/64347/22 "2004-09-28T11:40:15Z")

</div>

Sorry i’m not sure how this works, i know how to make the array so i have an array of length 32, with element 1 =1 (i’m not starting at zero, this shouldn’t be problem though?), 2=2, 3=3 etc then i have

```auto
 randomLine = Math.ceiling(Math.random()*lineStorage.length);
lineChosen = lineStorage[randomLine];

```

then have line thats chosen by ai  
\_root[“lineArray”+lineChosen][0] = 1;  
and then in drawing, i need to have  
if(\_root[“lineArray”+i][0] == 1){  
lineStorage.splice(i, 1);  
}  
cos if thats what i need it doesn’t seem to work, but i’ll look at it again

[Previous page](https://forum.kirupa.com/t/starting-out-with-logic-ai/64347.md?page=1)
