forgotusername

pyramid.au3

Sep 16th, 2021 (edited)
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 0.93 KB | None | 0 0
  1. Local $s = _
  2.         "!offset_x={x}" & @CRLF & _
  3.         "!offset_y={y} + 10" & @CRLF & _
  4.         "!offset_z={z}" & @CRLF
  5.  
  6. Local $x = 0, $y = 0, $z = 0
  7.  
  8. FileDelete('pyramid.txt')
  9.  
  10. $iterations = 115 ; size of the pyramid
  11. $offset = 1
  12.  
  13. $prefab = 'stone_wall_2x1'
  14.  
  15. Do
  16.     For $i = 1 To $iterations
  17.         $s &= StringFormat('%s %s %s %s 0 180 0', $prefab, $x, $y, $z) & @CRLF
  18.         $x += 2
  19.     Next
  20.  
  21.     $x -= 0.5
  22.     $z += 0.5
  23.     For $i = 1 To $iterations
  24.         $s &= StringFormat('%s %s %s %s 0 90 0', $prefab, $x, $y, $z) & @CRLF
  25.         $z += 2
  26.     Next
  27.  
  28.     $x -= 1.5
  29.     $z -= 1.5
  30.     For $i = 1 To $iterations
  31.         $s &= StringFormat('%s %s %s %s  0 0 0', $prefab, $x, $y, $z) & @CRLF
  32.         $x -= 2
  33.     Next
  34.  
  35.     $x += 1.5
  36.     $z -= 1.5
  37.     For $i = 1 To $iterations - 1
  38.         $s &= StringFormat('%s %s %s %s 0 -90 0', $prefab, $x, $y, $z) & @CRLF
  39.         $z -= 2
  40.     Next
  41.  
  42.  
  43.     $x = $offset
  44.     $y += 1
  45.     $z = $offset
  46.  
  47.     $offset += 1
  48.     $iterations -= 1
  49. Until $iterations < 0
  50.  
  51. FileWrite('pyramid.txt', $s)
  52.  
Add Comment
Please, Sign In to add comment