<!DOCTYPE html>
<meta charset="utf-8">
<title>Werewolves and Wanderer</title>
<h1>Werewolves and Wanderer</h1>
<script>
let originalFetch = window.fetch;

window.fetch = file => originalFetch(`target/wasm32-unknown-emscripten/debug/deps/${file}`);

window.input = null;

window.set_prompt = prompt => {
  console.log("Setting prompt to", prompt);
};

window.has_input = () => {
  return window.input === null ? 0 : 1;
};

window.set_input = val => {
  window.input = val;
};

window.get_input = () => {
  let input = window.input;
  window.set_input(null);
  return input;
};

window.Module = {
  print(msg) {
    console.log("PRINT", msg);
  }
};
</script>
<script src="target/wasm32-unknown-emscripten/debug/werewolves-and-wanderer.js"></script>

<!DOCTYPE html>
<meta charset="utf-8">
<title>Werewolves and Wanderer</title>
<h1>Werewolves and Wanderer</h1>
<script>
const TARGET_MODE = 'debug';
const BASE_PATH = `target/wasm32-unknown-emscripten/${TARGET_MODE}`;
const _originalFetch = window.fetch;

window.fetch = file => _originalFetch(`${BASE_PATH}/deps/${file}`);

window.input = null;

window.set_prompt = prompt => {
  console.log("Setting prompt to", prompt);
};

window.has_input = () => {
  return window.input === null ? 0 : 1;
};

window.set_input = val => {
  window.input = val;
};

window.get_input = () => {
  let input = window.input;
  window.set_input(null);
  return input;
};

window.Module = {
  print(msg) {
    console.log("PRINT", msg);
  }
};

window.addEventListener('DOMContentLoaded', () => {
  const script = document.createElement('script');

  script.setAttribute('src', `${BASE_PATH}/werewolves-and-wanderer.js`);
  document.body.appendChild(script);
});
</script>

Support debug/release mode in web version.
Support debug/release mode in web version.
