Build Your Own Protag Generator

This goes inside the <head> tag:

<script type="text/javascript">
<!--

  var a = Math.round(Math.random()*19)
  var b = Math.round(Math.random()*19)
  var c = Math.round(Math.random()*19)
  var d = Math.round(Math.random()*19)
  var e = Math.round(Math.random()*19)
  var f = Math.round(Math.random()*19)
  var g = Math.round(Math.random()*19)
  var h = Math.round(Math.random()*19)

  /* the number 19 above is the number
  of items in each array (counting from
  zero); 25 items counted from 0 would
  be 24 */

  var she1 = new Array(
  "a gentle",
  /* however many are desired;
     match number at top;
     no comma on last item */
  "an unhappy"
  )

  var she2 = new Array(
  "beer-drinking",
  /* however many are desired;
     match number at top;
     no comma on last item */
  "blue-eyed"
  )

  var she3 = new Array(
  "princess",
  /* however many are desired;
     match number at top;
     no comma on last item */
  "queen"
  )

  var she4 = new Array(
  "balanced on the knife edge between death and life.",
  /* however many are desired;
     match number at top;
     no comma on last item */
  "stolen at birth by fairies."
  )

  var he1 = new Array (
  "a beautiful",
  /* however many are desired;
     match number at top;
     no comma on last item */
  "an orphaned"
  )

  var he2 = new Array(
  "albino",
  /* however many are desired;
     match number at top;
     no comma on last item */
  "wandering"
  )

  var he3 = new Array(
  "abbot",
  /* however many are desired;
     match number at top;
     no comma on last item */
  "woodcutter"
  )

  var he4 = new Array(
  "bearing the weight of a secret remorse.",
  /* however many are desired;
     match number at top;
     no comma on last item */
  "with an evil older brother."
  )

  function randtext1() {
          document.write(she1[a])
  }
  function randtext2() {
          document.write(she2[b])
  }
  function randtext3() {
          document.write(she3[c])
  }
  function randtext4() {
          document.write(she4[d])
  }
  function randtext5() {
          document.write(he1[e])
  }
  function randtext6() {
          document.write(he2[f])
  }
  function randtext7() {
          document.write(he3[g])
  }
  function randtext8() {
          document.write(he4[h])
  }

  function refresh() {
          window.location.reload(false);
  }
// -->
</script>

This goes inside the <body> tag:

She's
  <script>randtext1()</script>
  <script>randtext2()</script>
  <script>randtext3()</script>
  <script>randtext4()</script>
He's
  <script>randtext5()</script>
  <script>randtext6()</script>
  <script>randtext7()</script>
  <script>randtext8()</script>

Together they will...

  <a href="javascript:refresh()">Try again</a>

Fantasy Protagonists Generator | www.williamswriting.com | sandrakwilliams.net