mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 16:15:41 +01:00
Initial release
This commit is contained in:
parent
90042b4f97
commit
896c60a8b9
60 changed files with 36730 additions and 2 deletions
82
test/samples/sample.php.txt
Normal file
82
test/samples/sample.php.txt
Normal file
|
|
@ -0,0 +1,82 @@
|
|||
<?php
|
||||
// The next line contains a syntax error:
|
||||
if () {
|
||||
return "The parser recovers from this type of syntax error";
|
||||
}
|
||||
?>
|
||||
<html>
|
||||
<head>
|
||||
<title>Example page</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<script type="text/javascript">
|
||||
// Some PHP embedded inside JS
|
||||
// Generated <?=date('l, F jS, Y')?>
|
||||
|
||||
var server_token = <?=rand(5, 10000)?>
|
||||
if (typeof server_token === 'number') {
|
||||
alert('token: ' + server_token);
|
||||
}
|
||||
</script>
|
||||
|
||||
<div>
|
||||
Hello
|
||||
<? if (isset($user)) { ?>
|
||||
<b><?=$user?></b>
|
||||
<? } else { ?>
|
||||
<i>guest</i>
|
||||
<? } ?>
|
||||
!
|
||||
</div>
|
||||
|
||||
<?php
|
||||
|
||||
/* Example PHP file
|
||||
multiline comment
|
||||
*/
|
||||
|
||||
$cards = array("ah", "ac", "ad", "as",
|
||||
"2h", "2c", "2d", "2s",
|
||||
"3h", "3c", "3d", "3s",
|
||||
"4h", "4c", "4d", "4s",
|
||||
"5h", "5c", "5d", "5s",
|
||||
"6h", "6c", "6d", "6s",
|
||||
"7h", "7c", "7d", "7s",
|
||||
"8h", "8c", "8d", "8s",
|
||||
"9h", "9c", "9d", "9s",
|
||||
"th", "tc", "td", "ts",
|
||||
"jh", "jc", "jd", "js",
|
||||
"qh", "qc", "qd", "qs",
|
||||
"kh", "kc", "kd", "ks");
|
||||
|
||||
srand(time());
|
||||
|
||||
for($i = 0; $i < 52; $i++) {
|
||||
$count = count($cards);
|
||||
$random = (rand()%$count);
|
||||
|
||||
if($cards[$random] == "") {
|
||||
$i--;
|
||||
} else {
|
||||
$deck[] = $cards[$random];
|
||||
$cards[$random] = "";
|
||||
}
|
||||
}
|
||||
|
||||
srand(time());
|
||||
$starting_point = (rand()%51);
|
||||
print("Starting point for cut cards is: $starting_point<p>");
|
||||
|
||||
// display shuffled cards (EXAMPLE ONLY)
|
||||
for ($index = 0; $index < 52; $index++) {
|
||||
if ($starting_point == 52) { $starting_point = 0; }
|
||||
print("Uncut Point: <strong>$deck[$index]</strong> ");
|
||||
print("Starting Point: <strong>$deck[$starting_point]</strong><br>");
|
||||
$starting_point++;
|
||||
}
|
||||
?>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Add table
Add a link
Reference in a new issue