Skip to content

Instantly share code, notes, and snippets.

#!usr/bin/ruby
#encoding: utf-8
#Kullanicinin girdigi sayiyi bilgisayarin tahmin etmesi
puts "Oyun oynamak icin 0-100 arasi bir sayi giriniz"
sayi = gets
tahmin_sayisi = 1
a, b = 0, 100
#!usr/bin/ruby
#encoding: utf-8
#Bilgisayarin urettigi sayiyi tahmin etme oyunu
puts "Tahmin icin 0-100 arasi bir sayi giriniz."
puts "Cikmak icin q ya basin"
tahmin_sayisi = 1
s = Random.new
@ecmelkytz
ecmelkytz / boncuk.m
Last active December 27, 2015 04:49
% sadece mavi boncukları gösterir
clear all; close all; clc;
im = imread('http://i.imgur.com/TwDQZKO.jpg');
bwr = r <= 50;
bwg = g <= 150;
bwb = b >= 125;
function boncuk_ayristirma(im)
im = imread('http://i.imgur.com/TwDQZKO.jpg');
subplot(3,2,1); imshow(sari(im));
subplot(3,2,2); imshow(mavi(im));
subplot(3,2,3); imshow(turuncu(im));
subplot(3,2,4); imshow(bordo(im));
subplot(3,2,5); imshow(siyah(im));
subplot(3,2,6); imshow(yesil(im));
end
function [image,mask] = chromaKey(background, foreground, key)
R = key(1);
G = key(2);
B = key(3);
imF = (foregrond(:,:,1)<=R) & (foreground(:,:,2)<=G) & (foreground(:,:,3)>B);
imFu = cast(~imF, 'uint8');
imFm = cast(imF, 'uint8');
imCk = cast(ones(size(background)),'uint8');
imCk(:,:,1) = background(:,:,1).*imFm + imFu.*foreground(:,:,1);
clear all;
clc;
im=imread('left_near.png');
t=graythresh(im);
im=im2bw(im,t);
[x,y]=size(im);
sol=im(1:x,1:y/2);
sag=im(1:x,y/2+1:y);
clc;
im=imread('zar.png');
resim=im;
t=graythresh(im);
im=imcomplement(im2bw(im,t));
say1=1;
say2=1;
l=bwlabel(im);
clc;
a=imread('cameraman.tif');
t=[2 0 0; 0 3 0; 0 0 1];
tform=maketform('affine',t);
k=imtransform(a,tform);
figure(1);
imshow(a);
figure(2);
clc;
im=imread('coins.png');
im=im2bw(im);
im=imfill(im,'hole');
subplot(2,2,1);
imshow(im)
label=bwlabel(im);
toplam=max(max(label));
@ecmelkytz
ecmelkytz / pandorabot1
Created February 14, 2014 16:14
Second Life connection with the pandorabots
key requestid;
key user;
string botid;
string cust;
string reply;
string newreply;
integer that_begin;
integer that_end;
integer cust_begin;