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
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
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
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
extern "C" int printf (__const char *__restrict __format, ...); | |
int main() | |
{ | |
printf("Hello world!\n"); | |
return 0; | |
} |
NewerOlder