Jamie Balfour

Welcome to my personal website.

Find out more about me, my personal projects, reviews, courses and much more here.

Run ZPE/YASS online

Run ZPE/YASS

Run ZPE/YASS code right here! ZPE compiles the code into a YASS Executable (YEX) file then runs it directly, taking advantage of ZPE's cache feature.

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

It should also be noted that the performance of running this is not as high as it would be if it was run natively on your computer system. This is due to a number of factors, for example, how quickly the result is sent across and how quickly the output is read and then displayed by PHP.

Here are some examples of code you can run (click the 'play' button 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) }
$v("Hello world")
	
YASS
structure person

  //Using strong typing here
  public string $first_name = "Jamie"
	public string $second_name = "Balfour"

	function _construct($f, $s)

    //One way of doing this
    if($f != undefined)
      this->$first_name = $f
		end if

    //Another way of doing this
		if(is_set($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 = new Date()
$d1 = string_to_date("25-10-2015 14:00:24", "dd-MM-yyyy hh:mm:ss")
print("The number of hours since 25-10-2015 14:00:24 is " & $now->date_diff($d1, "hours") & ".")
	
YASS
function fibonacci_generator($n)
  $x = 1
  $y = 2
	$results = [1, 1, 2]
  $i = 0
  //$n - 3 is used because we add the first three to the list ourselves
	while($i < $n - 3)
	  $t = fibonacci_inner($x, $y)
		$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
	
Output