@parks709 What's surrounded by the "/"s is called a regular expression. It's a way of processing text. "." means, select any character. "\w" is for whitespace. Regular expressions are a huge topic, so just do a Google search to find out more.
I am using latest version of ruby interactive on windows 7. When I type "Hello".each_char do [x], the program is giving me an error that says undefined variable. Is there a way to fix this?
@whitedragon812 If the code looks the way you posted it in your comments, the problem is a syntax error. There aren't supposed to be square brackets around the x variable, it's supposed to be the pipe character (usually found above the enter key).
Sometimes Using the Sub and G Sub Method for me don't always work proper. when using the Sub Method instead of it saying Goodbye world and it said Hello world and with G sub instead of saying Goodbye Hello hello it just said Hello Hello Hello, when I re-tried it couple of times it worked .. but it does go back to it not working proper at times.
You can use SharpKeys. It’s a small utility that will let you easily map one key to another key easily, or even turn the key off, without having to enter the registry at all. Just google it up.
(Woah, i accidentally deleted someone's comment when I meant to hit reply, sorry)
For everyone having trouble finding the pipe character: |, I haven't found a keyboard without it (though all the ones that I come in contact with are usually USA configuration, I haven't checked out any international ones). Keep in mind that it's usually above the enter key, and that it may not look like a complete line, it can have a break in the middle of it. Don't worry, it's still the same key.
hmm... from what I can tell, it might the button to the right of left-shift on your keyboard. Try pressing that key with shift and/or alt and see if the right letter pops out.
As for books, I thought Beginning Ruby From Novice to Professional was good.
I don't really understand the scan expression. Could you explain more on what (/../) or (/\w\w/) do?
parks709 2 months ago
@parks709 What's surrounded by the "/"s is called a regular expression. It's a way of processing text. "." means, select any character. "\w" is for whitespace. Regular expressions are a huge topic, so just do a Google search to find out more.
manwithcode 2 months ago
You sir, have just earned yourself a subscriber.
CaptainGibbons 2 months ago
@CaptainGibbons Excellent! :)
manwithcode 2 months ago
@CaptainGibbons lol what a coincidence I subscribed also. . . and I know you XD
ccofmight 2 months ago
I am using latest version of ruby interactive on windows 7. When I type "Hello".each_char do [x], the program is giving me an error that says undefined variable. Is there a way to fix this?
whitedragon812 2 months ago in playlist Programming With Ruby Tutorials
@whitedragon812 If the code looks the way you posted it in your comments, the problem is a syntax error. There aren't supposed to be square brackets around the x variable, it's supposed to be the pipe character (usually found above the enter key).
It should look like this: |x|
Not this: [x]
manwithcode 2 months ago
Sometimes Using the Sub and G Sub Method for me don't always work proper. when using the Sub Method instead of it saying Goodbye world and it said Hello world and with G sub instead of saying Goodbye Hello hello it just said Hello Hello Hello, when I re-tried it couple of times it worked .. but it does go back to it not working proper at times.
cashjamesPremium1 3 months ago
@cashjamesPremium1 Odd. I've never seen this happen before. Are you on Windows? What version of Ruby are you running?
manwithcode 3 months ago
@manwithcode i am using windows 7 Ultimate
cashjamesPremium1 2 months ago
@manwithcode i am Running the Newest Version ,the latest version
cashjamesPremium1 2 months ago
@cashjamesPremium1 I haven't been able to reproduce the problem you're encountering, are you sure you've typed the code in correctly?
manwithcode 2 months ago
Ehh im sorry again, but i just got it u.u its
x = "name"
puts x
very sorry but i don't understand whats the diffrence between
x = "name"
or
x = gets
Can you plz explain it to me, if its not to late
w2lf 8 months ago
Comment removed
w2lf 8 months ago
This has been flagged as spam show
@w2lf Got it again after reaching to episode 13, basicly gets is an input
w2lf 8 months ago
I have a question, is there a way to make a name into number?
I just want to write x = name but it only works with numbers that way.
w2lf 8 months ago
You can use SharpKeys. It’s a small utility that will let you easily map one key to another key easily, or even turn the key off, without having to enter the registry at all. Just google it up.
w2lf 8 months ago
Well everything works fine for me =D
w2lf 8 months ago
(Woah, i accidentally deleted someone's comment when I meant to hit reply, sorry)
For everyone having trouble finding the pipe character: |, I haven't found a keyboard without it (though all the ones that I come in contact with are usually USA configuration, I haven't checked out any international ones). Keep in mind that it's usually above the enter key, and that it may not look like a complete line, it can have a break in the middle of it. Don't worry, it's still the same key.
manwithcode 1 year ago
'.each_char' is not being recognised as a method, do I have to require anything?
Very informative video's. Do you think you would be able to create some tutorials on Monkeybars?
Annuix 2 years ago
Sorry for taking so long to respond...
I'm not sure why each_char isn't being recognized, what version of Ruby are you using?
manwithcode 2 years ago
Comment removed
elputube 1 year ago
@Annuix
try typing in require 'jcode'
elputube 1 year ago
How do I display a number stored in a variable as a string?
packered 2 years ago
It's the same as displaying a string except you have to use the "to underscore s" method on the variable.
(Youtube is being a pain, the method I talk about has no spaces, and it is the underscore character, not the word)
manwithcode 2 years ago
Comment removed
packered 2 years ago
I cant get the a = gets to work, whenever I write it in the code and run the program, it spits out "Errno::EBADF occorred
Bad file descrptor"
Ashadow700 2 years ago
I've never seen that error before, and I can't figure out how to replicate it.
Sorry.
manwithcode 2 years ago
Thank You
bigmit37 2 years ago
Not on mine :P probably different on an EU keyboard. I'll find it in the end, thanks for the response.
Doing an AS level in Computing in September, so will probably learn more then, but if you could recommend one book to me, what would it be?
I'm still basically a beginner, i've done some sketchy C++ work, and worked through your video's, but that's about it.
Thank you :)
slike101 2 years ago
hmm... from what I can tell, it might the button to the right of left-shift on your keyboard. Try pressing that key with shift and/or alt and see if the right letter pops out.
As for books, I thought Beginning Ruby From Novice to Professional was good.
manwithcode 2 years ago
@manwithcode it doesn't work for me either.
i tried everything. that character is nowhere to be found it's a major issue i can't do 40% of the things you teach.
eshed888 1 year ago
i cant find the symbol on each end of the x on my keyboard!? where abouts is it?
Really nice videos, learning alot
slike101 2 years ago
its above the Enter key
Glad you like the videos!
manwithcode 2 years ago
@manwithcode it's not there please help!
eshed888 1 year ago