-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implemented length operator. This closes #130
- Loading branch information
1 parent
31cd263
commit b08195e
Showing
6 changed files
with
156 additions
and
71 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
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
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
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
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,23 @@ | ||
const string a = "hello world"; // 11 | ||
float b[] = { 1, 2, 3 }; // 3 | ||
float c[5] = { 5, 4, 3, 2, 1 }; // 5 | ||
const float d[] = { 1 }; // 1 | ||
|
||
void main() { | ||
print(ftos(length a), "\n"); // 11 | ||
print(ftos(length b), "\n"); // 3 | ||
print(ftos(length c), "\n"); // 5 | ||
print(ftos(length d), "\n"); // 1 | ||
|
||
static float al = length(a); | ||
static float bl = length(b); | ||
static float cl = length(c); | ||
static float dl = length(d); | ||
|
||
print(ftos(al), "\n"); // 11 | ||
print(ftos(bl), "\n"); // 3 | ||
print(ftos(cl), "\n"); // 5 | ||
print(ftos(dl), "\n"); // 1 | ||
|
||
print(ftos(length "hello world"), "\n"); // 11 | ||
} |
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,13 @@ | ||
I: length.qc | ||
D: length operator | ||
T: -execute | ||
C: -std=gmqcc | ||
M: 11 | ||
M: 3 | ||
M: 5 | ||
M: 1 | ||
M: 11 | ||
M: 3 | ||
M: 5 | ||
M: 1 | ||
M: 11 |