Skip to content

Instantly share code, notes, and snippets.

@Yamabiko
Last active December 19, 2015 03:28
Show Gist options
  • Save Yamabiko/5889993 to your computer and use it in GitHub Desktop.
Save Yamabiko/5889993 to your computer and use it in GitHub Desktop.
# -*- coding: utf-8 -*-
require "curses"
include Curses
init_screen # スクリーンを初期化
string = "Hello World!"
setpos(lines / 2, cols / 2 - (string.length / 2))
# カーソル一位置
addstr(string) # カーソル位置に string を挿入(上書)
refresh # スクリーンを更新(addstrしたやつが表示される)
getch # 入力を1文字受け付ける
close_screen # スクリーンを閉じる
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment