Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
18 changes: 18 additions & 0 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"configurations": [
{
"name": "macos-clang-x64",
"includePath": [
"${workspaceFolder}/**"
],
"compilerPath": "/usr/bin/clang",
"cStandard": "${default}",
"cppStandard": "${default}",
"intelliSenseMode": "macos-clang-x64",
"compilerArgs": [
""
]
}
],
"version": 4
}
13 changes: 13 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "C/C++ Runner: Debug Session",
"type": "lldb",
"request": "launch",
"args": [],
"cwd": "/Users/katianawieser/libturtle/demo",
"program": "/Users/katianawieser/libturtle/demo/build/Debug/outDebug"
}
]
}
59 changes: 59 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
"C_Cpp_Runner.cCompilerPath": "clang",
"C_Cpp_Runner.cppCompilerPath": "clang++",
"C_Cpp_Runner.debuggerPath": "lldb",
"C_Cpp_Runner.cStandard": "",
"C_Cpp_Runner.cppStandard": "",
"C_Cpp_Runner.msvcBatchPath": "",
"C_Cpp_Runner.useMsvc": false,
"C_Cpp_Runner.warnings": [
"-Wall",
"-Wextra",
"-Wpedantic",
"-Wshadow",
"-Wformat=2",
"-Wcast-align",
"-Wconversion",
"-Wsign-conversion",
"-Wnull-dereference"
],
"C_Cpp_Runner.msvcWarnings": [
"/W4",
"/permissive-",
"/w14242",
"/w14287",
"/w14296",
"/w14311",
"/w14826",
"/w44062",
"/w44242",
"/w14905",
"/w14906",
"/w14263",
"/w44265",
"/w14928"
],
"C_Cpp_Runner.enableWarnings": true,
"C_Cpp_Runner.warningsAsError": false,
"C_Cpp_Runner.compilerArgs": [],
"C_Cpp_Runner.linkerArgs": [],
"C_Cpp_Runner.includePaths": [],
"C_Cpp_Runner.includeSearch": [
"*",
"**/*"
],
"C_Cpp_Runner.excludeSearch": [
"**/build",
"**/build/**",
"**/.*",
"**/.*/**",
"**/.vscode",
"**/.vscode/**"
],
"C_Cpp_Runner.useAddressSanitizer": false,
"C_Cpp_Runner.useUndefinedSanitizer": false,
"C_Cpp_Runner.useLeakSanitizer": false,
"C_Cpp_Runner.showCompilationTime": false,
"C_Cpp_Runner.useLinkTimeOptimization": false,
"C_Cpp_Runner.msvcSecureNoWarnings": false
}
60 changes: 53 additions & 7 deletions demo/demo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,73 @@

using namespace std;

void rect(Turtle& t, float width, float height) {
void rect(Turtle &t, float width, float height)
{
t.forward(width);
t.right(90);
t.set_decor_stitch(3);
t.forward(height);
t.right(90);
t.set_decor_stitch(1);
t.forward(width);
t.right(90);
t.set_decor_stitch(2);
t.forward(height);
t.right(90);
}

void penta(Turtle &t, float width)
{
t.decor_on(0);
for (int i = 0; i < 5; i++)
{
t.set_decor_stitch(i);
t.forward(width);
t.left(72);
}
}

void octa(Turtle &t, float width)
{

t.decor_on(0);
for (int i = 0; i < 8; i++)
{
if (i == 7)
{
t.decor_off();
}
else
{
t.set_decor_stitch(i);
}

t.forward(width);
t.left(45);
}
}

void meetTurtle() {
void meetTurtle()
{
Turtle t;
t.satinon(0.3);
t.pendown();
rect(t, 20, 30);
// t.satinon(0.3);

t.pendown();
// t.forward(10);
// t.decor_on(5);
// t.decor_on(6);

octa(t, 30);
// t.decor_on(4);
// rect(t, 30, 30);

// penta(t, 50);
// t.forward(60);
t.end();
t.save("demo.dst");
}

int main() {
meetTurtle();
int main()
{
meetTurtle();
}
Loading