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
require 'utils/version' | |
require 'open-uri' | |
require 'fastimage' | |
module Utils | |
#Pythonの配列のsliceと同等のメソッド | |
#stepは省略可。leftとrightは省略する代わりにnil | |
module Pyrb | |
def pickup(left, right, step=nil) | |
klass = self.class |
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
C:¥Users¥**¥Documents¥code¥Ruby>ruby convert.rb | |
無効なパラメーターです - b.bmp | |
converted | |
convert.rb: [BUG] Segmentation fault | |
ruby 2.2.2p95 (2015-04-13 revision 50295) [i386-mingw32] | |
-- Control frame information ----------------------------------------------- | |
c:0001 p:0000 s:0002 E:00042c TOP [FINISH] | |
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
#include "utilsc.h" | |
#include "math.h" | |
long gcd(long x, long y) { | |
long tmp; | |
if (x < y) {tmp = x; x = y; y = tmp;} | |
if (!y) return x; | |
return gcd(y, x % y); | |
} |
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
# encoding: Shift_JIS | |
# for Windows | |
require 'green_shoes' | |
Sf = %w(png PNG jpg jpeg JPG JPEG gif GIF bmp BMP) | |
class String | |
def imgfile? | |
return false unless m = /\.(.+)$/.match(self) | |
return m[1] if Sf.include?(m[1]) |
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
require 'bundler/setup' | |
require 'opengl' | |
require 'glut' | |
require './opengl_getbitmap' | |
include Gl, Glut | |
def init | |
glClearColor(0, 0, 0, 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
require 'bundler/setup' | |
require 'opengl' | |
require 'glut' | |
include Gl, Glut | |
class BitMap | |
def initialize(width, height, dpi = 96) | |
@width = width | |
@height = height | |
@line_size = width * 3 + (4 - (width * 3) % 4) % 4 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
module JankenAsobi | |
def play | |
player1 = Cp.new | |
player2 = Man.new | |
judge = Judge.new(player1, player2) | |
5.times {|i| judge.game(i + 1)} | |
judge.winner | |
end | |
module_function :play |
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
tomoki@tomoki-VJF152 ~ $ cd Documents/mruby/mruby | |
tomoki@tomoki-VJF152 ~/Documents/mruby/mruby $ make | |
ruby ./minirake | |
(in /home/tomoki/Documents/mruby/mruby) | |
CC src/init.c -> build/host/src/init.o | |
CC src/dump.c -> build/host/src/dump.o | |
CC src/vm.c -> build/host/src/vm.o | |
CC src/crc.c -> build/host/src/crc.o | |
CC src/compar.c -> build/host/src/compar.o | |
CC src/etc.c -> build/host/src/etc.o |
OlderNewer