From: arton Date: 2006-05-28T04:28:15+09:00 Subject: [ruby-list:42281] Re: メニューのループについて artonです。 _kbhitは不要でした。 ・1〜3を押しているときはメニューを表示 ・qなら終了 ・それ以外は無視 require 'dl/import' module MSVCRT extend DL::Importable if RUBY_PLATFORM =~ /mswin/ dlload "MSVCRT.DLL" extern "int _getch()" else puts "sorry, don't support your environment" exit(1) end end MENU = [?1,?2,?3] c = ?1 begin if MENU.include?(c) MENU.each do |i| printf("%c:test%c\n", i, i) end end c = MSVCRT._getch end until c == ?q -- arton -------------------------------------- Yahoo! JAPAN 10th Anniversary Special Feature --- Enjoy Yahoo! Auction with Yahoo! Mail !! --- http://pr.mail.yahoo.co.jp/auction/