To use this website fully, you first need to accept the use of cookies. By agreeing to the use of cookies you consent to the use of functional cookies. For more information read this page.

Test ZPE live

Run your own sandboxed ZPE commands here! Note that commands cannot contain an apostrophe as this will prevent the execution! Also note that commands can only run for a maximum of 1 second of execution time.

You can also find out the exact version information of this version by typing version into the command box.

Test ZPE
Output

	

Here are some examples of code you can run (click Execute to insert them into the textbox above and then run them):

YASS
print("Hello world")
	
YASS
print(5 + 5 * 2)
	
YASS
function main()
  for($i = 0 to 1000)
	  print($i)
  end for
end function
	
YASS
$x = function($m){print($m + 2)}
for($i = 0; $i < 10; $i++){
  $x(10 * $i)
}
	
YASS
$v =
function()
 print("Hi")
end function

//Lambda call
$v()

$v = ($x) => print($x) end function
$v("Hello world")
	
YASS
structure person

  public $first_name = "Jamie"
	public $second_name = "Balfour"

	function _construct($f, $s)

    if($f != "")
      this->$first_name = $f
		end if
		if($s != "")
      this->$second_name = $s
		end if

	end function

	public function getFirstName()
	  return this->$first_name
	end function

	public function getSecondName()
	  return this->$second_name
	end function
end structure

function main()
  $p = new person()
	print($p->getFirstName(), $p->getSecondName())
	$p = new person("John", "Addams")
	print($p->getFirstName(), $p->getSecondName())
end function
	
YASS
//Get the number of hours between now and 25-10-2015 14:00:24
$now = get_time()
$then = string_to_date("25-10-2015 14:00:24", "dd-MM-yyyy hh:mm:ss")
print($now->date_diff($then, "hours"))
	
YASS
function fibonacci_generator($n)
  $x = 1
  $y = 2
	$results = [1, 1, 2]
  $i = 0
	while($i < $n - 3)
	  $t = fibonacci_inner($x, $y)
		$results = $results.put($t)
		$x = $y
		$y = $t
		$i++
	end while

	return $results
end function

function fibonacci_inner($i, $j)
  return $i + $j
end function

function main()
  print(fibonacci_generator(10))
end function
	
YASS
for($i = 0 to 100)
  run_in_thread(function(){
    print("Hello " & $i)
  })
end for