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
extern "C" int printf (__const char *__restrict __format, ...); | |
int main() | |
{ | |
printf("Hello world!\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
package main | |
const ( | |
length = 16777216 | |
setto = 'x' | |
incby = 8 | |
) | |
func main() { | |
array := make([]byte, length) |
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
class Array | |
def each() | |
counter = 0 | |
while counter < self.len do | |
yield self[counter] | |
counter = counter + 1 | |
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
image = [ | |
[0,0,0,0], | |
[0,1,0,0], | |
[1,0,0,0], | |
[0,0,0,1] | |
] | |
image.each do |row| | |
puts row | |
puts "next" |
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
Array.new(rows){Array.new(columns)} | |
Array.new(rows) do | |
Array.new(columns) | |
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
Array.new(rows) do | |
return Array.new(columns) | |
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
Array.new(4) do | |
return 5 | |
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
class Array | |
def new(size) | |
counter = 0 | |
#some magic to set the array length to the size variable | |
while counter < size do | |
self[counter] = yield | |
counter = counter + 1 | |
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
0000 | |
0100 | |
0001 | |
0000 |
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
[0, 0, 0, 0] | |
[0, 1, 0, 0] | |
[0, 0, 0, 1] | |
[0, 0, 0, 0] |
OlderNewer