How do I test my code for Gamebook


So I am starting my java final Gamebook, and I was wondering what is the best way to test my code as I go to ensure everything is working properly?

Replace this line with your code.


In this project, you’ll build a game from scratch. You’ll leave Codecademy’s learning environment and build locally, on your own computer, testing and running the game in the browser.

You'll want to run and test with the console open so error messages are visible. Is the code performing as expected? What methodology have you established to rigorously test the edge cases? Have you devised ways to break your code, and then make it stronger?


So what I initially tried was opening my main html file directly in the browser to try playing the game. Is that the correct method? I was trying to create a thread for my game just like the one we created in the Threadly exercise, so i cut and pasted the code from that exercise into my code and it still didn't work in the browser. However, it works perfectly in the code academy site, and in a java code test site... why is that?

here is the java code:

var main = function() {
$('form').submit(function() {
var comment = $('#comment').val();

if(comment !== "") {
  var html = $('<li>').text(comment);

return false;



here is the HTML...

<!doctype html>
    <link href=',700' rel='stylesheet' type='text/css'>
  <link rel='stylesheet' href='style.css'/>

    <div class="header">
      <div class="container">

    <div class="main">
      <div class="container">
        <form class="form">
          <input id="comment" type="text" placeholder="share your thoughts">
          <button type="submit" class="btn">post</button>

        <ul class="comments">
          <li>Have you felt it?</li>
          <li>There has been an awakening.</li>

    <script src=""></script>
    <script src='script.js'></script>


Yes, that's the best way to test. See how it looks and feels. Is the behavior what is expected?

This site has jQuery loaded in the background, for one.

Add this script tag before your own js...

<script src=""></script>

Actually, I didn't scroll down far enough to see that you already have it coming from CC. I recommend you use the above CDN, rather than CC's Amazon account.


I hate life right now... That was such a stupid mistake. I deleted a bunch of old code because I thought I had made a mistake and the whole time it was just the missing jQuery script tag... Thank you very much mtf I appreciate your help.