Tom's JavaScript Machine

[ Machine | Instructions | Examples | JavaScript Basics | Challenge | Hints | About ]

The Generalized Challenge

This challenge is a generalization of the (first) Challenge, which we assume you have completed. It was already briefly stated in the Afterthoughts on the first Challenge. Here is a more complete description of the Generalized Challenge:

Write a program G for Tom's JavaScript Machine

This Generalized Challenge will lead you into the heart of the foundations of theoretical computer science. In particular, at the end of the accompanying hints we will consider a very special function f related to the (hypothetical) halting function H. This function takes as argument a string with a JavaScript program and supposedly returns whether execution of this program, without input, halts.

Notes:

As with the first challenge, you are encouraged to write a program

  1. that uses only these JavaScript basics and extensions,
  2. that adheres to reasonable coding conventions, in particular, source lines must be no longer than 80 characters (this makes for a more interesting challenge), and

These requirements could be dropped initially, but using extra JavaScript features is not necessary and can be distracting. User-defined functions can be helpful, as well as the predefined constants QU and NL.

In case you get stuck, you can look at some hints.


Valid HTML 4.01 Transitional

©2009-2010, Tom Verhoeff (TU/e)
Feedback about this page is welcome