Wikiの書き方

(版間での差分)
移動: 案内, 検索
細 (→プログラムの色付)
細 (→GeSHi)
60行: 60行:
 
     echo $v;        // end of php code
 
     echo $v;        // end of php code
 
?>
 
?>
−
</syntaxhighlight>
 
−
 
−
 
−
<syntaxhighlight lang="lua">
 
−
-- User define
 
−
local tx = 3
 
−
local ty = 4
 
−
 
−
function digTree()
 
−
  local success, result = turtle.inspect()
 
−
  if not success then
 
−
    -- 前に何もない
 
−
    return false
 
−
  end
 
−
 
−
  turtle.dig()
 
−
  turtle.forward()
 
−
 
−
  -- 幹を全て崩す
 
−
  local upCount = 0
 
−
  while true do
 
−
    local success, result = turtle.inspectUp()
 
−
    if success and result.name == "minecraft:log" then
 
−
      turtle.digUp()
 
−
      turtle.up()
 
−
      upCount = upCount + 1
 
−
    else
 
−
      -- 上に何もない
 
−
      break
 
−
    end
 
−
  end
 
−
  while upCount > 0 do
 
−
    turtle.down()
 
−
    upCount = upCount - 1
 
−
  end
 
−
 
−
  return true
 
−
end
 
−
 
−
for x = 1, tx do
 
−
  for y = 1, ty do
 
−
    turtle.forward()
 
−
    turtle.forward()
 
−
    digTree()
 
−
  end
 
−
  for y = 1, ty do
 
−
    turtle.back()
 
−
    turtle.back()
 
−
    turtle.back()
 
−
  end
 
−
  turtle.turnLeft()
 
−
  turtle.forward()
 
−
  turtle.forward()
 
−
  turtle.forward()
 
−
  turtle.turnRight()
 
−
end
 
−
 
−
turtle.turnRight()
 
−
for x = 1, tx do
 
−
  turtle.forward()
 
−
  turtle.forward()
 
−
  turtle.forward()
 
−
end
 
−
turtle.turnLeft()
 
 
</syntaxhighlight>
 
</syntaxhighlight>
  

2016年5月28日 (土) 11:43時点における版

目次


書き方

samples

画像

2016-05-23 test2.png

SyntaxHighlighter

プログラムの色付け

-- User define
local tx = 3
local ty = 4
 
function digdag()
  turtle.dig()
  turtle.forward()
 
  return true
end
 
for x = 1, tx do
  for y = 1, ty do
    turtle.forward()
    turtle.turnRight()
  end
end

Check any syntaxes

※ここから先は管理者用のテストエリアです

ファイル:2016-05-23 test.png

GeSHi

<?php
    $v = "string";    // sample initialization
?>
html text
<?
    echo $v;         // end of php code
?>

SyntaxHighlighter

// SyntaxHighlighter makes your code snippets beautiful without tiring your servers.
// http://alexgorbatchev.com
var setArray = function(elems) {
    this.length = 0;
    push.apply(this, elems);
    return this;
}
個人用ツール
名前空間
変種
操作
案内
ツールボックス