I have this small program, or something like it as this just bigger:
t = gets
k = gets
When I run test2.rb it asks for user input. But I want the program to
get this input from a file instead of asking the user. And I do not want
to change the code in test.rb. I can only change the code in test2.rb or
make new files, but I cant change test.rb
I only now how to do this by running the program from the console
ruby test2.rb < input.txt
But that is not what I want. I want to do this inside the program. I do
not want the user to start it in the console like that. I want the user
only to start the program an th program get the input from the file (or
a text string in the program code) it self.
I am new to ruby, and new to this kind of programming, so please don’t
kill me if it is a stupid question.