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
package pancake; | |
import haxe.Constraints.Function; | |
/** | |
* ... | |
* @author Rabia Haffar | |
*/ | |
@:native("window.navigator.app") | |
extern class NavigatorApp { |
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
function arr2obj(array) { | |
var result = {}; | |
for (var i = 0; i < array.length; i++) { | |
result[(i).toString()] = array[i]; | |
} | |
return result; | |
} |
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
function sizeof(o) { | |
if (typeof(o) == "object") { | |
if (o.length !== void 0) { | |
return o.length; | |
} else { | |
var i = 0; | |
for (var k in o) i++; | |
return i; | |
} | |
} else if (typeof(o) == "string") { |
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
function copy_array(a, t) { | |
var result = []; | |
if (t == 0 || t == 1) { | |
result = a; | |
} else { | |
for (var i = 0; i <= t - 1; i++) { | |
for (var j = 0; j < a.length; j++) result.push(a[j]); | |
} | |
} | |
return result; |
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
# Written by Rabia Alhaffar in 27/November/2020 | |
# OpenLumines 1st test: Block rotation | |
# This demonstrates a Lumines block and it's rotatable with up arrow key. | |
=begin | |
Supporters: | |
@kniknoo | |
@LeviDuncanPixel | |
@Hiro_r_b | |
=end | |
def tick args |
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
-- Written by Rabia Alhaffar in August/2020 | |
local function pyramid(n) | |
local result = nil | |
if (n > 0) then | |
result = {} | |
for i = 1, n, 1 do | |
result[i] = {} | |
for j = 1, i, 1 do | |
result[i][j] = 1 | |
end |
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
-- Written by Rabia Alhaffar in 27/September/2020 | |
-- Even or Odd example | |
local function even(a) | |
if ((a % 2) == 0) then | |
return true | |
else | |
return false | |
end | |
end |
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
-- Written by Rabia Alhaffar in 26/September/2020 | |
-- Simple way to get biggest and smallest number from table in Lua | |
local function bignum(t) | |
local _ = -math.huge | |
for i in ipairs(t) do | |
if (t[i] >= _) then | |
_ = t[i] | |
end | |
end | |
return _ |
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
public static class Rectangle extends Raylib.Rectangle { | |
public Rectangle() { | |
super(); | |
} | |
public Rectangle(float x, float y, float width, float height) { | |
x(x); | |
y(y); | |
width(width); | |
height(height); | |
} |
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
-- Written by Rabia Alhaffar in June 14, 2021 | |
-- Simple script to detect some operating systems and CPU architecture via Lua! ;) | |
-- Updated: June 14, 2021 | |
-- Also, I would thank NickWilde263 and Nameless on GitHub for their suggestions! <3 | |
-- https://github.com/NickWilde263 | |
-- https://github.com/truemedian | |
local sys = { | |
arch = "UNKNOWN", |
OlderNewer