Skip to content

Instantly share code, notes, and snippets.

@huseyin
Created March 2, 2015 14:13
Show Gist options
  • Save huseyin/2f302238b038ead28efb to your computer and use it in GitHub Desktop.
Save huseyin/2f302238b038ead28efb to your computer and use it in GitHub Desktop.
nesnelere hareketli görüntüsü kazandıma
# encoding: utf-8
#
# Terminal'de objeye hareketli görüntüsü verdik.
# Saçma işler :))
#
require 'rake/clean'
require 'time'
id = { sol: "\n\t\u{2190}",
sol_ust: "\n\t\u{2196}",
ust: "\n\t\u{2191}",
sag_ust: "\n\t\u{2197}",
sag: "\n\t\u{2192}",
sag_alt: "\n\t\u{2198}",
alt: "\n\t\u{2193}",
sol_alt: "\n\t\u{2199}", }
puts ''
sh 'clear'
while true
sleep 0.5
sh 'clear'
print id[:sol]
sleep 0.5
sh 'clear'
print id[:sol_ust]
sleep 0.5
sh 'clear'
print id[:ust]
sleep 0.5
sh 'clear'
print id[:sag_ust]
sleep 0.5
sh 'clear'
print id[:sag]
sleep 0.5
sh 'clear'
print id[:sag_alt]
sleep 0.5
sh 'clear'
print id[:alt]
sleep 0.5
sh 'clear'
print id[:sol_alt]
end
puts ""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment