# Hackathon project Help please

**URL:** <https://forum.code.org/t/hackathon-project-help-please/35776>\
**Category:** Coding and Debugging Help\
**Created:** [January 25, 2022, 5:17am UTC](https://forum.code.org/t/hackathon-project-help-please/35776 "2022-01-25T05:17:13Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![rcoulon](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/rcoulon/32/7262_2.png) [@rcoulon](https://forum.code.org/u/rcoulon)\
**Post date:** [January 25, 2022, 5:17am UTC](https://forum.code.org/t/hackathon-project-help-please/35776/1 "2022-01-25T05:17:13Z")

</div>

**Student stuck: words not showing up next to dog image.**

**[Link to the project or level:**([App Lab - Code.org](https://studio.code.org/projects/applab/aWTCZKIHofNn1lEe0FxBE-hqHgEaycD9gcAL7dpCmpQ))

**What I expect to happen:** [when either button is clicked, a picture of a dog and breed names should show up but they names are not showing up.]

**What actually happens:** [The picture shows but not the names.

**What I’ve tried:** [compared old code that partially worked. I’m stuck too!

Old code link: [App Lab - Code.org](https://studio.code.org/projects/applab/aWTCZKIHofNn1lEe0FxBE-hqHgEaycD9gcAL7dpCmpQ)]

---

<div class="post-metadata">

**Author:** ![mwood](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/mwood/32/4941_2.png) [@mwood](https://forum.code.org/u/mwood)\
**Post date:** [January 25, 2022, 5:59am UTC](https://forum.code.org/t/hackathon-project-help-please/35776/2 "2022-01-25T05:59:56Z")

</div>

I see a few small errors that are easy to make …

The first is in line 19. Breed is a full array. Think about what your conditional is trying to compare.

The 2nd error is in line 25. When you run it, you will see that you have a uistring error. In this case, you are trying to set the “text” to be an array when “text” should be a string. (btw, you can’t use [i] here as you aren’t in the middle of an [i] loop).

Can you find a way to convert the contents of the entire array to be a string?

Does this help?

Mike

---

<div class="post-metadata">

**Author:** ![rcoulon](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/rcoulon/32/7262_2.png) [@rcoulon](https://forum.code.org/u/rcoulon)\
**Post date:** [January 25, 2022, 6:12am UTC](https://forum.code.org/t/hackathon-project-help-please/35776/4 "2022-01-25T06:12:09Z")

</div>

Thank you sooo much! Will fix tomorrow

---

<div class="post-metadata">

**Author:** ![bhatnagars](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/bhatnagars/32/4919_2.png) [@bhatnagars](https://forum.code.org/u/bhatnagars)\
**Post date:** [January 25, 2022, 6:14am UTC](https://forum.code.org/t/hackathon-project-help-please/35776/5 "2022-01-25T06:14:23Z")

</div>

There are several things missing in the **updateScreenWorker()** and **updateScreen()** functions. In the **updateScreenWorker** , we need a string where all the dog names must be concatenated to add to the text area. We also need a separate index variable for the WorkerNames list. See the code below.

```
function UpdateScreenWorker() {
  var s = ""; //String to save all the Worker Dog names
  var j = 0; //index for the WorkingNames list
  for (var i = 0; i < DogNames.length; i++) {
    if (Breed[i] == "Working") {
      appendItem(WorkerNames, DogNames[i]);
      s += WorkerNames[j] + "\n"; //Add the dog name to the list
      j++; //increment the index
    }
  }
  console.log(WorkerNames);
  setScreen("LLworkers");
  setProperty("LLWorkers", "text", s); //set the text to the string that contains all the dog names
}
```

Similar changes need to made to the **UpdateScreen** function.

---

<div class="post-metadata">

**Author:** ![rcoulon](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/rcoulon/32/7262_2.png) [@rcoulon](https://forum.code.org/u/rcoulon)\
**Post date:** [January 25, 2022, 6:15am UTC](https://forum.code.org/t/hackathon-project-help-please/35776/6 "2022-01-25T06:15:02Z")

</div>

Did you see my other question regarding “/n”?

---

<div class="post-metadata">

**Author:** ![rcoulon](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/rcoulon/32/7262_2.png) [@rcoulon](https://forum.code.org/u/rcoulon)\
**Post date:** [January 25, 2022, 12:56pm UTC](https://forum.code.org/t/hackathon-project-help-please/35776/7 "2022-01-25T12:56:11Z")

</div>

Thank you so much, will do the changes!!

---

<div class="post-metadata">

**Author:** ![rcoulon](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/rcoulon/32/7262_2.png) [@rcoulon](https://forum.code.org/u/rcoulon)\
**Post date:** [February 14, 2022, 5:03am UTC](https://forum.code.org/t/hackathon-project-help-please/35776/8 "2022-02-14T05:03:58Z")

</div>

Hey this code was updated and it worked. Thanks!
