# Hackathon - CSP

**URL:** <https://forum.code.org/t/hackathon-csp/40617>\
**Category:** Unit and Lesson Discussion\
**Created:** [March 31, 2025, 6:27pm UTC](https://forum.code.org/t/hackathon-csp/40617 "2025-03-31T18:27:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jmehringer](https://avatars.discourse-cdn.com/v4/letter/j/f05b48/32.png) [@jmehringer](https://forum.code.org/u/jmehringer)\
**Post date:** [March 31, 2025, 6:27pm UTC](https://forum.code.org/t/hackathon-csp/40617/1 "2025-03-31T18:27:25Z")

</div>

I have a couple of projects where students aren’t getting the results they want.

> **[Check out what I made](https://studio.code.org/projects/applab/U0QiSjnYBJMHvGBhgvgMjfVkbDdbJm4FaWdFF-Z7xFU)**
>
> I wrote the code myself with Code.org

in this one, it appears the index numbers for the list items are showing up instead of the actual contents of the list.

in this one the students get an undefined return in the two areas where they want list items showing up.

> **[Check out what I made](https://studio.code.org/projects/applab/r-nLipm2_Ve8T6NGMsA2gQ7H3owwLoiMkVFAQ57x7Rs)**
>
> I wrote the code myself with Code.org

Any and all help with these would be appreciated - I have others with similar problems, so hoping any help I receive here would help with those other projects too.  
Thanks, in advance!

---

<div class="post-metadata">

**Author:** ![varrience](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/varrience/32/8042_2.png) [@varrience](https://forum.code.org/u/varrience)\
**Post date:** [April 1, 2025, 10:37am UTC](https://forum.code.org/t/hackathon-csp/40617/2 "2025-04-01T10:37:22Z")

</div>

the first one you aren’t selecting an index from an array  
I.E.

```js
console.log(rollercoasterList[index])

```

for the second one i commented everything out that was not useful

```js
var stateNames = getColumn("US States", "State Name");
var stateNicknameList = getColumn("US States", "Nickname");
// var filterNickname = [];
// var filterStateName = [];
//filter();
onEvent("randomButton", "click", function () {
  showstates();
  //filter();
});
// function filter() {
// filterNickname = [];
// filterStateName = [];
// for (var i = 0; i < stateNames.length; i++) {
// if (stateNames[i] == stateChoice) {
// appendItem(filterNickname, stateNicknameList[i]);
// appendItem(filterStateName, stateNames[i]);
// }
// }
// }
function showstates() {
  var stateChoice = randomNumber(0, stateNames.length - 1);
  var randomStateName = stateNames[stateChoice];
  var randomStateNickname = stateNicknameList[stateChoice];
  setText("fakeName1", "Aligator state");
  setText("fakeName", "Everglade state");
  setText("realName", randomStateName + "");
  setText("State_Area", randomStateNickname + "");
}

```
