Skip to content

Commit 71950aa

Browse files
committed
output 폴더 추가
1 parent 4430bad commit 71950aa

File tree

5 files changed

+18
-12
lines changed

5 files changed

+18
-12
lines changed

.vscode/launch.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
// 자세한 내용을 보려면 https://go.microsoft.com/fwlink/?linkid=830387을(를) 방문하세요.
55
"version": "0.2.0",
66
"configurations": [
7+
78
{
89
"name": "Python",
910
"type": "python",

Mython/src/Convert.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import mcpi.minecraft as minecraft
22
import mcpi.block as Block
33
import math
4+
import os
45

56
def Convert(x1, y1, z1, x2, y2, z2):
67
mc = minecraft.Minecraft.create()
@@ -69,5 +70,9 @@ def Convert(x1, y1, z1, x2, y2, z2):
6970
textData += " }\n"
7071
textData += "}\n"
7172

72-
with open("convert.txt", 'wt') as file:
73+
curDir = os.path.dirname(os.path.realpath(__file__))
74+
fullDir = curDir + '\output'
75+
if not os.path.isdir(fullDir):
76+
os.mkdir(fullDir)
77+
with open(curDir + "\output\convert.txt", 'wt') as file:
7378
file.write(textData)
173 Bytes
Binary file not shown.

Mython/src/convert.txt

Lines changed: 0 additions & 11 deletions
This file was deleted.

Mython/src/output/convert.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
var map = [0, 0, 0, 5, 5, 5, 1, 1, 1, 0, 0, 0, 5, 5, 5, 1, 1, 1, 0, 0, 0, 0, 5, 5, 0, 1, 1];
2+
var i = 0
3+
4+
for(x = 0; x < 3; x++) {
5+
for(y = 0; y < 3; y++) {
6+
for(z = 0; z < 3; z++) {
7+
cube(x, z, y, map[i]);
8+
i++;
9+
}
10+
}
11+
}

0 commit comments

Comments
 (0)