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
float dataMin = MAX_FLOAT; | |
float dataMax = MIN_FLOAT; |
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
x <- 5 # => 5 | |
x = 5 # => 5 |
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
x,y,z = gets.chomp.split(' ').map { |s| s.to_i } | |
arr = Array.new(x) { Array.new(y) { Array.new(z)} } | |
num_z = z + 1 | |
_x = 0 | |
x.times do | |
_z = 0 | |
num_z.times do | |
line_cell = gets.chomp | |
if (line_cell == "--") | |
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
N = gets.to_i | |
scores = [] | |
N.times do | |
scores << gets.chomp.to_i | |
end | |
scores = scores.sort {|a,b| b <=> a} | |
flag0 = scores.inject(:+) < 1 | |
Q = gets.to_i | |
Q.times do | |
limit = gets.chomp.to_i |
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
def who_am_i(&block) | |
block.class | |
end | |
puts who_am_i {} | |
class Array | |
def iterate!(code) | |
# selfオブジェクトの要素数だけ繰り返す | |
self.each_with_index do |n,i| |
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: utf-8 | |
require 'csv' | |
data = [] | |
# データ作成 | |
File.open("words.txt", "r:utf-8") do |f| | |
f.each_line do |line| | |
word = line.split(' ')[0] | |
count = line.split(' ')[1].to_i |
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
using UnityEngine; | |
using System.Collections; | |
public class PointingController : MonoBehaviour | |
{ | |
public GameObject wall; | |
public float distance; | |
public void Update() | |
{ | |
// マウスの位置を取得 |
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 class Touch : MonoBehaviour { | |
// rayが届く範囲 | |
public float distance = 100f; | |
void Update () { | |
// 左クリックを取得 | |
if (Input.GetMouseButtonDown(0)) { | |
// クリックしたスクリーン座標をrayに変換 | |
Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); | |
// Rayの当たったオブジェクトの情報を格納する |
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
Shader "Custom/mouse_position" { | |
Properties { | |
_MainTex ("Texture", 2D) = "white" {} | |
} | |
SubShader { | |
Tags { "RenderType" = "Opaque" } | |
CGPROGRAM | |
#pragma surface surf Lambert vertex:vert | |
struct Input { | |
float2 uv_MainTex; |
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
Shader "Custom/shock_wave" { | |
Properties { | |
} | |
SubShader { | |
Pass { | |
// GLSLシェーダ | |
GLSLPROGRAM | |
#ifdef VERTEX | |
void main() |