Skip to content
Browse files

a blank screen

  • Loading branch information...
1 parent aee3b2c commit 9dd2ccffbc81a76df548f5baf3adbf75dae804df @grosser committed Dec 31, 2010
Showing with 31 additions and 4 deletions.
  1. +2 −4 Rakefile
  2. +29 −0 bin/tic_tac_toe
View
6 Rakefile
@@ -1,7 +1,5 @@
-task :default => :spec
-require "rspec/core/rake_task"
-RSpec::Core::RakeTask.new(:spec) do |t|
- t.rspec_opts = '--backtrace --color'
+task :default do
+ exec "./bin/tic_tac_toe"
end
begin
View
29 bin/tic_tac_toe
@@ -0,0 +1,29 @@
+#!/usr/bin/env ruby
+require 'curses'
+
+def write(x,y,text)
+ Curses.setpos(y,x)
+ Curses.addstr(text);
+end
+
+def init_screen
+ Curses.noecho
+ Curses.init_screen
+ begin
+ yield
+ ensure
+ Curses.close_screen
+ end
+end
+
+init_screen do
+ write(0,0,'TEST')
+ write(0,10,'Y')
+ write(10,0,'X')
+
+ loop do
+ case Curses.getch
+ when ?q then break
+ end
+ end
+end

0 comments on commit 9dd2ccf

Please sign in to comment.
Something went wrong with that request. Please try again.