starbase吧 关注:366贴子:2,090
  • 13回复贴,共1

【wiki】翻译中英对照版——YOLOL编程

只看楼主收藏回复

一楼喂度娘


IP属地:广东1楼2020-04-05 16:50回复
    Summary简介
    YOLOL is a programming language used tocontrol and manage electrical devices.
    YOLOL是一种用于控制和管理电子设备的编程语言。
    The code is written on lines in YOLOL chipswhich are then inserted into chip sockets, that read and relay their messages.
    将代码逐行写在YOLOL芯片上,随后将芯片插在芯片插槽中,读取和转发它们的信息。
    The programming language enables theprogramming and controlling of almost any device within the known universe.
    这种编程语言可以用于规划和控制已知宇宙内的几乎所有电子设备。


    IP属地:广东2楼2020-04-05 16:50
    回复
      Commandreferences 命令参考
      Case insensitive 大小写不区分
      The programming language is fully caseinsensitive.
      本编程语言完全不区分大小写。
      This means that the following two examplescripts function identically to each other:
      这意味着下面的两个示例脚本彼此之间的作用相同:
      if ButtonState == 1 then DoorState= 1 end
      IF buttonstate == 1 THEN doorstate= 1 END
      Both scripts set the doorstate into 1, ifbuttonstate value is 1.
      这两个脚本在buttonstate的值为1时,将doorstate的值设为1。
      The characters in the programming languagecan be written in either lowercase or uppercase letters.
      在该编程语言中字符可以用小写字母或大写字母来书写。
      Theyare still parsed as case insensitive.
      它们的解析仍然不区分大小写
      Thisway it's possible to have the code look a bit more organized.
      可以用这种方式使代码看起来更有条理
      Variables 变量
      The variables in the programming languageare weakly typed (don't enforce type validity), and support two data types:Fixed-point decimals (up to 0.001 precision) and Strings.
      该程序语言中的变量为弱类型(不强制变量类型的有效性),并提供两种数据类型:定点小数(精确到小数点后3位)和字符串。
      Toput it simply, the variables can either be introduced as strings or numbers,ignoring the earlier variable type if the previous type is not identical,without causing an error.
      简而言之,这些变量可以被引入作为字符串或数字,如果与先前的变量类型不一致则忽略较早的变量类型,不会产生错误。
      Each variable is always of a single type,though it will be implicitly converted when required.
      每个变量总是单一类型的,尽管它会在需要时被隐式转换。
      The default value of an uninitializedvariable is 0, and null values are not supported.
      一个未初始化的变量的默认值是0,并且不支持空值。
      True/False are numerical values of non-0and 0.
      True/False(真/假)的值为非零或零的数值
      True =! 0
      True =! 0(真的值不为0)
      False == 0
      False == 0(假的值为0)
      Assigning a value to a variable alwaysconverts the variable to the newly assigned value's type.
      为一个变量赋值时变量的值类型总是转换为被赋予的值的值类型。
      Example:
      例如:
      ultimateAutopilot= 128.643
      This results in the variableultimateAutopilot containing a numeric value of 128.643
      这将使变量ultimateAutopilot的值变为128.643。
      ultimateAutopilot= "Error prone"
      This results in the variable ultimateAutopilotto be a string variable "Error prone", and numeric value of 128.643is removed
      这将使变量ultimateAutopilot的值变为字符串类型的“Error prone”,而数值类型的值128.643将会被覆盖
      Decimals 小数
      Numeric values in the programming languageare 64-bit fixed-point decimals.
      该编程语言中的数值是64位定点小数。
      The variables hold decimal numbers up tothree decimal accuracy.
      变量为十进制并且精确到小数点后3位。
      As a result, the maximum value range (evenduring operations) is [-9223372036854775.808, 9223372036854775.807]
      其结果是最大数值范围(即使在操作中)是[-9223372036854775.808,9223372036854775.807]
      pieVariable= 3.142
      Theabove script assigns a numeric value of 3.142 to the variable pieVariable.
      上述脚本为变量pieVariable赋值为数值3.142。
      Supplying more precise values than thevariables can store works, but doesn't affect the end result.
      允许在作业中存储精确度更高的数值变量,但不会影响最终结果。
      notPieVariable= 0.5772156649
      Theabove script attempts to assign a numeric value of 0.5772156649 to the variablenotPieVariable.
      上述脚本尝试为变量notPieVariable赋值为0.5772156649。
      The endresult however is notPieVariable == 0.577
      然而最终结果为notPieVariable== 0.577
      Here, the more precise values are cut,leaving only three decimals behind.
      此处更精确的值被切断,只留下小数点后三位
      Strings 字符串
      Tospecify a string literal in the programming language, the desired string valuemust be surrounded with double quotation marks.
      在该编程语言中要指定字符串,字符串的值要使用双引号包含起来。
      badRobots= "saltberia"
      Thisscript assigns the string value of "saltberia" to the variablebadRobots.
      该脚本为变量badRobots赋值为字符串saltberia。
      Devicefields / External variables 设备参数/外部变量
      Externalvariables and device fields can be used in the programming language with thefollowing syntax:
      外部变量和设备参数可以通过以下语法在该编程语言中使用:
      :variableName
      variableName being the configureddevice field id.
      variableName是所配置的设备参数的ID。
      A colonprefix : is used to tell the script that an externable variable is beingaccessed, instead of using one that may or may not be declared or used in thescript.
      冒号前缀:用来告知该脚本正在访问一个外部变量,而不是在该脚本内的变量,无论它是否被使用或声明。
      Aprogrammable chip that is connected to a device has access to all the devicesin the same network.
      一个连接到设备的可编程芯片可以访问同一网络中的所有设备。
      It canthen modify and listen to any device fields it has access to.
      它可以修改和监听它所访问到的任何设备参数。
      if :ButtonState == 1 then :DoorState = 1 end
      Thescript above will send the value of 1 to any devices listening to the devicefield DoorState if the value of ButtonState is 1 in the data network.
      如果数据网络中任何监听中的设备的设备参数ButtonState的值为1,这个脚本将发送值1到该设备的DoorState设备参数。


      IP属地:广东4楼2020-04-05 16:51
      回复
        Operators and commands 操作和命令
        Notethat the available operators may be limited by the type of the programmablechip.
        注意可编程芯片的型号会限制可使用的操作
        Basicchips have a limited selection of functions while more advanced ones canperform more complex operations natively.
        基础芯片可选的功能有限,而更高级的芯片可在本地进行更复杂的操作。
        Basicarithmetic and assignment operators 基础的算数和赋值运算符




        Logical operators逻辑运算符
        Logicaloperators are checks that identify if the statement is true or false.
        逻辑运算符将检查确认语句是真或假。
        Alllogical operations return either "0 for False" or "1 forTrue"
        所有逻辑运算返回“0代表假”或“1代表真”

        It'salso possible to use not, and and or keywords to set up more complicatedconditions than simple variable value checks.
        它也可以使用not,and和or关键词来设置比简单的变量值检查更复杂的情况


        IP属地:广东5楼2020-04-05 16:54
        回复
          Comments注释
          Commentsare useful when writing code that is used by a lot of programmers.
          当程序员编写代码时注释是非常有用的。
          Notethat comments also use up space from the pre-determined 70 character line limitand are not excluded from it.
          注意,注释也被限制在一行的70个字符内,而不是被排除在外。
          Commentingis used with the following syntax:
          使用注释的语法如下:
          // text
          Text can be any single-line set of characters.
          text可以是任何单行的字符集
          // This is a comment. It will explain how other lines of script work.
          Anexample of a possible comment syntax
          一个注释语法示例


          IP属地:广东7楼2020-04-05 16:55
          回复
            Errors 错误
            Thereare two types of errors that can happen with the programming language.
            该编程语言可能发生两种类型的错误。
            1. Syntax errors
            1. 语法错误
            2. Runtime errors
            2. 运行错误
            Syntaxerrors come from invalid and unparseable script and will result in the wholeline not being executed.
            语法错误来自无效且不可解析的脚本,将导致整行代码无法执行。
            Runtimeerrors are only catchable while the script is being executed. They result inthe execution of the line being interrupted, but any effects until the errorwill remain.
            只有在脚本被执行时才能捕获运行错误。它们会导致行的执行被中断,但在错误发生之前不会有任何影响。


            IP属地:广东8楼2020-04-05 16:55
            回复
              以上翻译内容由太阳神公会wiki制作组提供,详情见抠群757813118


              IP属地:广东9楼2020-04-05 16:57
              回复


                IP属地:浙江来自Android客户端10楼2020-04-05 17:10
                回复
                  另附网页虚拟编译器http【】s://yolo【】xide.cyl【】on.xyz/ 复制后去掉【】


                  IP属地:广东11楼2020-04-05 17:26
                  回复
                    真棒(/≧ω\)真棒(/≧ω\)


                    IP属地:四川来自Android客户端12楼2020-04-05 21:10
                    回复
                      我写个无穷递归的YOLO插人家船上岂不是可以卡死别人


                      IP属地:四川来自iPhone客户端13楼2020-04-07 22:19
                      回复
                        好帖当顶


                        IP属地:广东来自Android客户端14楼2020-04-08 09:56
                        回复
                          看不懂 下一个


                          IP属地:浙江来自Android客户端15楼2020-04-08 10:02
                          回复
                            抬走下一个


                            IP属地:福建来自Android客户端16楼2020-04-08 17:22
                            回复