伪代码 - 示例

Posted cisum

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了伪代码 - 示例相关的知识,希望对你有一定的参考价值。

来源于:jade

伪代码: 一般用来模拟真实代码的一种简写方式

 

伪代码:

 1 !!! 5
 2 html(lang="en")
 3   head
 4     title= pageTitle
 5     :javascript
 6       | if (foo) {
 7       |    bar()
 8       | }
 9   body
10     h1 Jade - node template engine
11     #container
12       - if (youAreUsingJade)
13          You are amazing
14       - else
15          Get on it!
16          Get on it!
17          Get on it!
18          Get on it!

 

真实代码:

<!DOCTYPE html>
<html lang="en">
  <head>
    <title>Jade</title>
    <script type="text/javascript">
      //<![CDATA[
      if (foo) {
          bar()
      }
      //]]>
    </script>
  </head>
  <body>
    <h1>Jade - node template engine</h1>
    <div id="container">
      <p>You are amazing</p>
    </div>
  </body>
</html>    

 

以上是关于伪代码 - 示例的主要内容,如果未能解决你的问题,请参考以下文章