+ 2

Can someone tell me what is wrong with my code?

def command==input\n if command==list("") puts"list:root,hack,Iplookup" elsif command == "root" puts "Rooting android phone.\n" puts "Please wait\n" puts "Your phone is rooted" elsif command == "hack" puts "Hacking protocol...\n" puts "Footprinting\n" puts "ACESS GRANTED" elsif command == "IPlookup" puts "Looking up IP..." puts "Your IP is..." puts "123.456.789" end

8th Jul 2018, 9:37 PM
Petar
Petar - avatar
12 Answers
+ 2
Petar Bubalo Sorry was busy. Did you get your code to work? I tried to change some parts and it turned out fine. https://code.sololearn.com/cdy20QQHyNDT/?ref=app
9th Jul 2018, 12:47 PM
HoĆ ng Nguyį»…n Văn
HoĆ ng Nguyį»…n Văn - avatar
+ 1
There should be 2 "end" keywords, one for the if statement, one for the function definition
8th Jul 2018, 11:13 PM
HoĆ ng Nguyį»…n Văn
HoĆ ng Nguyį»…n Văn - avatar
+ 1
Petar Bubalo what is input\n ? If you're prompting input from user, use "gets" instead.
9th Jul 2018, 8:50 AM
HoĆ ng Nguyį»…n Văn
HoĆ ng Nguyį»…n Văn - avatar
+ 1
Petar Bubalo Is what you posted the entire code? Try setting a new name for your function and call it later. Naming a function by assigning variable is a bit confusing.
9th Jul 2018, 9:04 AM
HoĆ ng Nguyį»…n Văn
HoĆ ng Nguyį»…n Văn - avatar
+ 1
Ok
9th Jul 2018, 9:05 AM
Petar
Petar - avatar
+ 1
Yes, i named my variable var
11th Jul 2018, 8:33 AM
Petar
Petar - avatar
+ 1
I added engage and connect
11th Jul 2018, 8:38 AM
Petar
Petar - avatar
0
I tried
9th Jul 2018, 8:48 AM
Petar
Petar - avatar
0
I'll try
9th Jul 2018, 8:51 AM
Petar
Petar - avatar
0
Gets is right, but there are another errors
9th Jul 2018, 8:55 AM
Petar
Petar - avatar
0
Do i need class
9th Jul 2018, 9:06 AM
Petar
Petar - avatar
0
It's very confusing
9th Jul 2018, 9:13 AM
Petar
Petar - avatar