Skip to content

Instantly share code, notes, and snippets.

@shim0mura
Created August 2, 2012 09:16
Show Gist options
  • Save shim0mura/3235719 to your computer and use it in GitHub Desktop.
Save shim0mura/3235719 to your computer and use it in GitHub Desktop.
7巻はよ
# -*- coding: utf-8 -*-
# ncursesw(とその後にruby入れ直し)が必要
# sudo apt-get install libncursesw5-dev
require "curses"
include Curses
def set_red
init_pair 1, COLOR_RED, COLOR_BLACK
attrset(color_pair(1))
end
def show_heart
set_red
0.upto(lines/2 - 1) do |n|
addstr("❤ " * ((cols - 3)/2) + "\n")
end
end
def show_abara
col = (cols - 11) / 4
addstr("❤ " * col)
init_pair 2, COLOR_WHITE, COLOR_BLACK
attrset(color_pair(2))
addstr("あばら骨")
set_red
addstr("❤ " * col + "\n")
end
init_screen
start_color
begin
crmode
setpos(0 , 0)
show_heart
show_abara
show_heart
refresh
getch
ensure
close_screen
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment