Skip to content

Instantly share code, notes, and snippets.

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