Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8453229
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T11:42:55+00:00 2026-06-10T11:42:55+00:00

(Windows 7 x64 running Ruby 1.9.3) Here’s the situation: I’ve made text game in

  • 0

(Windows 7 x64 running Ruby 1.9.3)

Here’s the situation: I’ve made text game in Ruby, and I’m using the traditional gets method to get input from the user. When something is happening in the game (i.e. stuff is being printed to the screen), whatever the user has typed for input gets lost and the user has to continue typing what he/she has typed on a new line. What he/she has originally typed before it got lost is still there, just doesn’t get shown.

If the above didn’t make sense try executing this code, and you’ll see the problem:

Thread.new do
    loop do
        puts "Hello!"
        sleep 2
    end
end

Thread.new do
    loop do
        gets
    end
end

What I want is the line printed (in this case "Hello!") to be placed before the line the user is typing into.

I understand that to achieve this I might need to delve into the Windows API. It may even be impossible. But if there’s a way, I’d really like to know.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T11:42:57+00:00Added an answer on June 10, 2026 at 11:42 am

    The most useful libraries for creating interactive terminal programs are Curses and Readline. The former lets you move the cursor anywhere in the terminal, print in colors, create separate “windows”, etc. The latter is essentially a robust alternative to gets, with command history and autocompletion like in irb.

    If you want to use Curses with Threads, you can check out my fork of Ruby, which adds this functionality (as well as refactoring the entire curses library).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm running Windows 7 - x64 Edition with IIS 7.5 I have a simple
So on my server running Windows Server 2008 x64 R2 I installed the Java
I have a 32-bit application that must run on a Windows x64 server using
I'm attempted to install the bzip2-ruby gem on Windows 7 x64. Now I don't
I'm running Visual Studio Developer Preview 2011 on a Windows 7 x64 machine. I'm
At home I've been running VS 2010 on a Windows 7 x64 machine without
We have a Windows Server 2003 (x64) running as a Database server. The Database
I am running windows 7 x64 enterprise. I have Office 2010 x64 installed. I
I'm using eclipse on a windows 7 x64 to create a new Java Application.
I am running a MySQL 5.5 on a x64 Windows Server and keep getting

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.