This repository has been archived by the owner on Jul 6, 2023. It is now read-only.
forked from Bluefire2/xic
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e4467bf
commit 956e8f0
Showing
4 changed files
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
// Halts the program if the condition is false. Otherwise, does nothing. | ||
assert(condition:bool) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// String conversion functions | ||
|
||
// If "str" contains a sequence of ASCII characters that correctly represent | ||
// an integer constant n, return (n, true). Otherwise return (0, false). | ||
parseInt(str: int[]): int, bool | ||
|
||
// Return a sequence of ASCII characters representing the | ||
// integer n. | ||
unparseInt(n: int): int[] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// I/O support | ||
|
||
print(str: int[]) // Print a string to standard output. | ||
println(str: int[]) // Print a string to standard output, followed by a newline. | ||
readln() : int[] // Read from standard input until a newline. | ||
getchar() : int // Read a single character from standard input. | ||
// Returns -1 if the end of input has been reached. | ||
eof() : bool // Test for end of file on standard input. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// Returns an opaque representation of current time. | ||
// Note: the contents of the returned array are implementation specific | ||
// and should not be accessed directly. | ||
getTimestamp(): int[] | ||
|
||
// Returns the time elapsed from r to l (e.g. l - r) in milliseconds, | ||
// when given two arrays returned by getTimestamp(). | ||
// The behavior when the arrays are not from that function is undefined. | ||
// The useful range is about 24 days. | ||
timestampDifference(l:int[], r:int[]): int |