1

My Son 用 Shoes 制作了一个好玩的程序,它与 ruby​​ 基本相同,但有一个 gui。(我在语法上知道的唯一区别是alert而不是puts。)他在运行它时出错,看着我。我找不到所有这些错误的原因。* 是分类信息的替代品。

谢谢你

Shoes.app do
 #revised lines 1-17
 line = ask "Password (lowercase)"
  if line == "password"
     #superuser password for fast login
     alert "Logged In"
     name = ask "Name (lowercase)"
      if name == "***"
         alert "Welcome, ***"
         alert "Now, please verify your identity"
         idconfirm = ask "What is your 4 digit ID number; if unknown, type 'u'"
          if idconfirm == "u"
             alert "Please contact *** immediatly at ********@gmail.com"
          end
          if idconfirm == "******"
             alert "Administrator Code accepted"
             alert "What do you wish to do now?"
             stack(:align => "center") { #stack is for buttons
                 button "Latest projects (bip)" do
                     stack(:align => "center") { #stack is for paragraph and buttons
                         para "==================================================================
                         build an IRC bot FRAMEWORK
                         learn more languages
                         tri-boot?
                         backup files for win 8 clousre (WHEN NECESSARY)"
                         button "Rblx Assignments" {
                             rblxconf = ask "PASSCODE"
                              if rblxconf == "***********"
                                 #not FINISHED continue                           
                                 para(:align => "center") #CHECK LINE PARA_NTHESES
                                 "===============================================================
                                 learn roblox script
                                 build own admin script
                                 build roblox ***
                                 find other ways to *******"
                              else
                               alert "Not Correct" #revise alert
                              end
                            }
                        }
                   end
                 button "WELCOME"
                }
       end


#revised  up to here CONFIRMED
         if idconfirm == "****"
             alert "Thank You, ***. What do you want to do now?"
             stack(:align => "center") do #stack is for buttons
                 button "Latest projects (bip)" do
                     stack(:align => "center") {
                         para "==================================================================
                         build an IRC bot FRAMEWORK
                         learn more languages
                         tri-boot?
                         backup files for win 8 clousre (WHEN NECESSARY)"
                         button "Rblx Assignments" {
                             rblxconf = ask "PASSCODE"
                             if rblxconf == "***********"
                                 #not FINISHED continue                           
                                 para(
                                 :align => "center")
                                 "===============================================================
                                 learn roblox script
                                 build own admin script
                                 build roblox ***
                                 find other ways to *******"
                             else 
                              alert "Not Correct"
                             end
                            }
                        }
                    end
                 button "WELCOME"
                 button "Admin Log In" do
                     adminconfirm = ask "Admin Code (Hint:MMORPG accounts)"
                      if adminconfirm == "******" 
                         alert "Administrator Code accepted"
                         alert "What do you wish to do now"
                         #IN PROGRESS
                      end
                 end
             end
         end
      else
       alert "Your name is not registered"
      end      
  #superuser password for fast login
  else
   alert "Wrong Password"
  end
 #REVISED UP TO HERE [CONFIRMED]

 # +=========================================================================================================================================================
 #REVISE EVERYTHING OK?
 #revise 25 39 42 55 78 82 & 86 and more ;P
end
4

1 回答 1

0

尝试将所有“{”切换为“do”,将“}”切换为“end”。一旦我这样做了,我就停止了错误。

没有任何鞋子经验,我不知道为什么这很重要。但是两者之间存在细微差别 - 请参阅do..end 与 Ruby 中的块的花括号

于 2012-08-29T19:40:35.270 回答