-
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
8c9bd55
commit a3c5134
Showing
12 changed files
with
172 additions
and
132 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,6 @@ | ||
fn test() [Int] { | ||
var list: [Int] = [500, 5, 7]; | ||
foreign fn print(x: String) Void; | ||
|
||
vpushi(list, 3); | ||
vpushi(list, 3); | ||
vpushi(list, 3); | ||
vpushi(list, 5); | ||
|
||
var x: Int = vpopi(list); | ||
vpushi(list, x); | ||
vpushi(list, x * 2); | ||
vpushi(list, x * 3); | ||
|
||
return list; | ||
} | ||
|
||
fn testtwo(list: [Int]) Int { | ||
#vpopi(list); | ||
var x: Int = vpopi(list); | ||
return x; | ||
} | ||
|
||
fn testthree(list: [Int]) Int { | ||
var x: Int = vlen(list); | ||
return x; | ||
} | ||
|
||
foreign fn testback(x: Int) Void; | ||
|
||
fn testfour(list: [Int]) Int { | ||
vseti(list, 0, 888); | ||
var i: Int = 0; | ||
while i < vlen(list) { | ||
var value: Int = vgeti(list, i); | ||
testback(value); | ||
i = i + 1; | ||
} | ||
fn main() Int { | ||
print("gaming\n"); | ||
return 0; | ||
} | ||
|
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 |
---|---|---|
@@ -1,34 +1,37 @@ | ||
foreign fn termpos(x: Int, y: Int); | ||
foreign fn print(str: String); | ||
foreign fn printint(i: Int); | ||
foreign fn as_int(x: Float) Int; | ||
|
||
foreign fn termpos(x: Int, y: Int) Void; | ||
|
||
fn main() Int{ | ||
var size: Float = 200.0; | ||
var maxVal: Float = 4.0; | ||
var maxIter: Int = 50; | ||
var maxIter: Float = 50.0; | ||
var plane: Float = 4.0; | ||
# lmao | ||
var x: Int = 0; | ||
var x: Float = 0.0; | ||
while x < size { | ||
var y: Int = 0; | ||
var y: Float = 0.0; | ||
while y < size { | ||
var cReal: Float = (x * plane / size) - 2.0; | ||
var cImg: Float = (y * plane / size) - 2.0; | ||
var zReal: Float = 0.0; | ||
var zImg: Float = 0.0; | ||
var count: Int = 0; | ||
while (zReal * zReal + zImg * zImg) <= maxVal && count < 4{ | ||
var count: Float = 0.0; | ||
while (zReal * zReal + zImg * zImg) <= maxVal && count < maxIter { | ||
var temp: Float = (zReal * zReal) - (zImg * zImg) + cReal; | ||
zImg = 2.0 * zReal * zImg + cImg; | ||
zReal = temp; | ||
count = count + 1; | ||
count = count + 1.0; | ||
} | ||
if count == maxIter { | ||
termpos(x, y); | ||
if as_int(count) == as_int(maxIter) { | ||
termpos(as_int(x), as_int(y)); | ||
print("*"); | ||
} | ||
y = y + 1; | ||
y = y + 1.0; | ||
} | ||
x = x + 1; | ||
x = x + 1.0; | ||
} | ||
return 0; | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Oops, something went wrong.