none
Another Turtle Graphics RRS feed

  • General discussion

  • I made another Turtle Graphics program with Small Basic: XVK119-0.

    I'd like to start Turtle Graphics Project with this program and continue to develop further programs for this project.  Because the Turtle Graphics is the very beginning of programming.

    Opening screen shot of a program Turtle Graphics 0.1

    Running screen shot of a program Turtle Graphics 0.1

    Currently there are three commands:

    MOVE distance
    PEN UP|DOWN
    TURN LEFT|RIGHT|angle


    Nonki Takahashi


    Friday, March 21, 2014 1:11 AM
    Moderator

All replies

  • I like it when people post stuff like this. Thanks Nonki.

    I just checked out the MIT licence. What a top idea. First time I've seen it. Proliferate good software for free (ex copyright) with a way to help prevent people passing off the code as their own. That's how I read it anyway.

    Friday, March 21, 2014 3:02 PM
    Moderator
  • This is really cool!

    Ed Price, Power BI & SQL Server Customer Program Manager (Blog, Small Basic, Wiki Ninjas, Wiki)

    Answer an interesting question? Create a wiki article about it!

    Wednesday, March 26, 2014 11:43 PM
    Owner
  • I uploaded the Turtle image to TechNet Wiki Gallery.
    http://gallery.technet.microsoft.com/Turtle-PNG-Bitmap-for-582b449c

    Nonki Takahashi

    Thursday, June 12, 2014 12:21 AM
    Moderator
  • I also uploaded a PowerPoint slide about this project.
    http://gallery.technet.microsoft.com/Small-Basic-Deck-Another-2f724b78

    Screen shot of a page of slides in AnotherTurtle.ppx


    Nonki Takahashi

    Thursday, June 12, 2014 2:52 AM
    Moderator
  • QZP213

    new version, introduced IF clause , Skip clause :$, and remark //explanation

    syntax:

    IF <m><v2>;<v1> <skip lines to false>

    true part

    :$<lines to skip>

    false part

    <m> can be one of following signs = > < !( !=<>)

    <v1> number or %n var reference (n=1 to f hex) value to compare

    <v2> number or %n var reference (n=1 to f hex) value to compare

    u must manualy change skip lines for every new line added to if clause! 

    if condition is written right to left i.e. IF %1>3 is written as IF >3;%1

    if ommitted else number of lines to skip, assumed as 2 default

    -must always write :$ to skip else part of if clause

    - must always be present false part of if clause

    - can write //else for helping

    -:$0 means next line, :$1 means 1 lines to skip, etc...

    example:

    {5
    |X1=0
    |C2=0
    |pp=0

    $
    {2
    |pp+1
    |X1~5
    |C2~15

    U
    &
    D
    {15
    F %2
    IF =2;%3 2
    R %1
    :$2
    //else
    L %1

    |X1+1.93
    }
    }
    U
    &
    U
    F 65
    ##

    Saturday, April 25, 2015 10:10 PM
  • now a bit of designing and logomaking w LOGO))

    new font definition, circle drawing, matrix...

    imp.code: TFW525

    {1

    |F1=Calibri;1;1;50
    |F2=Tahoma;0;0;15
    |F3=Vivaldi;0;0;20
    |Xx.1 =LOGO Designer
    |xx.2 =Speed and Quality
    |xx.3 =Quick Brown Fox Jumps over lazy dogs and just keep echtings for zinc code

    ~H
    L 15
    U
    ~B#150
    {3

    #F %$
    IF =3;%$$ 3
    `C#aaaabb
    WB#%M.%$$
    :$2
    //else
    `CBlack
    WRT %M.%$$
     
    F 57
    }


    ~H
    U
    L 145

    F 250
    R 145
    D
    |F1~0
    |F2~0
    |F3~15
    {4
    |F3+-3
    {5
    |F1~5
    |F2~15

    U
    {15
    #C %3
    F %2

    R |F1
    |F1+1.93
    }
    }
    }

    ##

    Sunday, April 26, 2015 11:50 AM
  • Cool efect drawing:

    {1
    //imp. code:NHX824
    |X1;Just keep on echtings zync dreaming
                                         
    U
    #F Calibri;0;0;20
    {2
    {36
    F 18
    L 5
    #P
    WRT %M.%$$
    @1
    }
    }
    ##

    <sub1
    $
    L 90
    {5
    F 15
    WRT o

    ]
    //
    &
    &
    >

    Sunday, April 26, 2015 7:44 PM
  • Hi Tryhest,

    You done a lot of work, but your code uses some different extensions (LitDev ext is OK, Data ext, ESL) and objects like FilePlus, MathPlus, Clipboard, ESLMaths, ESLText and will only run with SB 1.0 and not any more with SB 1.1, where the other extensions (except LitDev's) will not work anymore. Maybe you should consider to replace as much objects and functions as possible with equal functions from LitDev extension. eg. FilePlus.FileExists you can replace with LDFile.Exists,  Dialogs.ShowMessageBox with LDDialogs.Confirm etc. For Clipboard object there is no official replacement at the moment for SB 1.1. But this could ev. be commented out. Unfortunatelly i can't run your code at the moment. I'm searching for a way to run SB 1.0 and SB 1.1 parallel anyhow. If that fails i'll change back to SB 1.0 as there the benefits clearly outweigh for me, but others working on SB 1.1 will never be able to use your code in the current version. A short look at it lets assume that most of this unusabe objects and methods above could be replaced with LitDev extension methods. Just an idea, but i would guess, the less different extensions, the better.


    Sunday, April 26, 2015 10:31 PM
    Answerer
  • LD is a great xtension pack, but doesnt contain all VB net4.5 fw methods

    how to use LDInline.includeVB method? I can't find examples((


    • Edited by Tryhest Monday, April 27, 2015 10:42 AM
    Monday, April 27, 2015 6:17 AM
  • some upgrade:  FQK141 imp. code

    and nice prog))

    {1
    //code FQK141
    //disp.some cool unicode chars
    |X1=0
    |X2=9665
    #F Arial;0;0;20
    U
    {72
    |X1'%2
    |X2+1
    F 20
    R 5
    WRT %1
    }
    ##

    Monday, April 27, 2015 5:12 PM
  • ... How to use LDInline.includeVB method?

    For a first sample, look in the downloaded LitDev_v1.x.zip\other-samples\  the files:

    LDInline.sb and LDInline-Reflection.sb (with code1.vb, code1.cs).

    Monday, April 27, 2015 7:08 PM
    Answerer
  • and cool animation effects combining shapes n logo code))

    {1
    //animation sample: imp:QPJ207
    {12

    #O>
    R 90
    F 50
    L 120
    F 50
    #O#1
    $
    R 135
    U
    F 1200
    ~15

    #OA %X;%Y;1;1500
    ~150
    &
    D
    }
    ##

    Monday, April 27, 2015 7:50 PM
  • now updated for SB1.1!

    import code: QQF794

    not all funcs are same bcs of missing extensions for  sb1.1

    major changes:

    IF =aa;bb;cc instead of IF =aa;bb cc

    after }  loops must be a //rem line

    added animation code

    #O> begins object 4 animate

    #O#n ends obj. and assign number

    #OA x;y;n;dd  animate object n to pos. (x,y) in <dd> msecs

    #OM x;y;n  moves object n to pos. (x,y)

    {1
    //animation sample:
    {12

    #O>
    R 90
    F 50
    L 120
    F 50
    #O#1
    $
    R 135
    U
    F 1200
    ~15

    #OA %X;%Y;1;1500
    ~150
    &
    D
    }
    //
    ~H
    U
    F 60
    L 90
    F 40
    #F Calibri;1;1;25
    WRT Logo power!
    ##

    Tuesday, April 28, 2015 8:09 AM
  • flickr pics clock
    works only in SB 1.1 as u know flickr was disabled in SB 1.0

    code: BPN924

    {1
    //pics4flickr BPN924
    U
    R 90
    F 300
    L 90
    {12

    L 30
    F 200

    #I:Sun;%X;%Y;200;150
    ~1250

    }
    ##

    Tuesday, April 28, 2015 2:52 PM
  • now updated for SB1.1!

    ... and that works great !

    (Had to resize a bit to fit on my screen)

    PS: About extensions: Take a look at latest LitDev's'Beta Version' (LitDev_Test.zip). He added LDClipboard object (same method names and MORE, like FileLists) !!

    At this point great thanks to LitDev himself !!

    Further, the 'SayPlus' extension (SPExtra.SendKeys) comes with source and can be recompiled for SB 1.1., same with ESL extension.

    Maybe you also wanna replace your outcommented  'MathPlus.GetDegrees(MathPlus.ATan2(....' with LitDev's LDMath.Convert2Radial(x1, y1, x2, y2) -> "1=r;2=φ[°];" anyhow ??

    .. and there are also LDMath.Evaluate and LDMath.Evaluate2  for math. expressions with constant values, if you want (not yet checked, what's in 'linee').  Just as hints.

    Had probs running 10=Clock (contextmenu), but i guess, i changed a bit too much :-), trimmed some spaces aso and get 12 lines 'V2 VAR-notfnd!'. Maybe i should reimport and start again from the beginning :-(.



    Tuesday, April 28, 2015 6:46 PM
    Answerer
  • a nice turtle clock by animated turtle moving around in secs!
    be aware not to press CLS othervise turtle hides forever(( due to some SB bug

    code:TZJ639
    usage: right press and select Clock and then run...
    enjoy!

    Tuesday, April 28, 2015 8:42 PM
  • Hi Tryhest, see LDShapes.ResetTurtle
    Tuesday, April 28, 2015 8:56 PM
    Answerer
  • nice, now turtle visible again))

    and added math and clipboard too

    XKQ873

    {11
    // imp:XKQ873
    |aa=0
    |bb=0
    |cc=0

    #E 3.1415926/360
    |cc~%1

    {60
    #E Math.Sin(%2*%3)*60

    R %1

    #E Math.Cos(%2*%3)*30
    F %1

    |bb+6
    }
    ##


    • Edited by Tryhest Tuesday, April 28, 2015 10:07 PM
    Tuesday, April 28, 2015 9:49 PM
  • be sure to use LD beta instead of LD regular

    Tuesday, April 28, 2015 9:51 PM
  • when using evaluate and evaluate2, is used as temp var %1

    then be sure not to store usefull data in it,

    as it will be overwritten by eval funcs...

    Tuesday, April 28, 2015 9:54 PM
  • looks like we 're getting a new powerful hiperlanguage mix of logo, vb, vc#,c++, python and so on...

    a bit is hard to understand the program at first sight, but when u get into the mood u can understand the easiness and powerfulness as well as shortness of code))

    Tuesday, April 28, 2015 10:10 PM
  • a nice logo flag sewing machine...

    please be patient to the end... sewing takes a lot of time even in logo lang.)))

    code: WMM047

    Wednesday, April 29, 2015 7:40 AM
  • Hi Tryhest,

    Thank you for sharing your cool programs!

    Your developing speed is too high for me.  I can't follow your programs...
    Anyway, I rewrote your NHX824 to run in my Windows Vista PC: NHX824-0.

    Screen shot of a program Turtle Graphics (NHX824-0)


    Nonki Takahashi

    Wednesday, April 29, 2015 9:18 AM
    Moderator
  • U r free to rewite as u wish to))

    some sewed letters too...

    code: XVZ567

    Wednesday, April 29, 2015 3:05 PM
  • @ Your developing speed is too high for me.  I can't follow your programs...

    Incredible, yes. There's no bloody beginner at work :-)


    Wednesday, April 29, 2015 6:10 PM
    Answerer
  • some more letters))

    the inspiration comes with working, like a divine gift...))

    code:JHZ794

    now much faster drawing, by replacing the turtle code w standard draw routines)

    and a tribute to EXPO))

    code: LSL249

    • Edited by Tryhest Thursday, April 30, 2015 9:47 PM
    Thursday, April 30, 2015 7:30 AM
  • some 3d perspective example:

    code: FMZ241

    usage: use mouse wheel to adjust angle, ctrl+wheel adjusts other angle, move mouse around to see results and different perspectives

    showing an edge of building w 2 glass surfaces

    Thursday, April 30, 2015 5:20 PM
  • That's pretty impressive, and i'll have to check this out over the weekend. just like the others above. Great !!

    ... the inspiration comes with working, like a divine gift...  :-) More on some days, less on others.

    Thursday, April 30, 2015 11:28 PM
    Answerer
  • sure)) when it comes, has to be exploited))

    now some circular sewing letters

    code:LGD567

    Friday, May 1, 2015 11:18 PM
  • an update:MLX947

    -simplified letters definition

    -shorten code

    -nicer chars))

    -circle tilting))

    Saturday, May 2, 2015 10:31 PM
  • a nice turtle clock by animated turtle moving around in secs!
    be aware not to press CLS othervise turtle hides forever(( due to some SB bug

    code:TZJ639
    usage: right press and select Clock and then run...
    enjoy!

    Tryhest, this works with SB 1.1 and LitDev Extension 1.1!  Thanks.

    Screen shot of a Turtle Graphics program TZJ639


    Nonki Takahashi


    Sunday, May 3, 2015 4:48 AM
    Moderator
  • a nice logo flag sewing machine...

    please be patient to the end... sewing takes a lot of time even in logo lang.)))

    code: WMM047

    Nice!  This program works with SB 1.1 and LitDev Extension 1.1 also.

    Screen shot of a Turtle Graphics program WMM047


    Nonki Takahashi


    Sunday, May 3, 2015 4:50 AM
    Moderator
  • an update:MLX947

    -simplified letters definition

    -shorten code

    -nicer chars))

    -circle tilting))

    Simple code.

    Screen shot of a Turtle Graphics program MLX947


    Nonki Takahashi


    Sunday, May 3, 2015 4:52 AM
    Moderator
  • This is the latest version of my Turtle Graphics program XVK119-3.

    Screen shot of a program Turtle Grahics 0.4b

     This program has following LOGO compatible commands:

    • FORWARD n (to move the turtle n pixels)
    • RIGHT n (to rotate the turtle right n degrees)
    • LEFT n (to rotate the turtle left n degrees)
    • PENUP (to lift the pen up)
    • PENDOWN (to set the pen down)
    • REPEAT n [commands] (to repeat commands n times)

    * I wrote this code as a challenge in Challenge of the Month - April 2015.


    Nonki Takahashi


    Sunday, May 3, 2015 5:26 AM
    Moderator
  • a typography experimentation prog: LWZ091

    use mouse wheel and sliders to adjust bold, height, kerning and so on...
    pay attention to prog title displays current option selected

    vertical slider has 8 settings
    hor. slider adjust char to kern
    text box select num of next chars to kern in group...
    after doling adjust use list button to save values
    fist row is kerning, second is mem var.
    have fun and experiment....))

    Wednesday, May 6, 2015 1:13 AM
  • flickr image analyzer:MFH321

    displays r g b gry cy m y channels and histogram

    Wednesday, May 6, 2015 8:22 AM
  • and now a db index of nonki listings))

    code:

    ZHK900

    read comments prior to run

    and uncomment req'd lines

    Wednesday, May 6, 2015 10:07 PM
  • fishy tiles XHD796

    adjust boldness by mousewheel

    Friday, May 8, 2015 6:55 AM
  • some fractals: TNH911

    adjust type by slider then press draw

    move mouse to display fractal and use wheel to resize/zoom

    Friday, May 8, 2015 2:49 PM
  • linear raster emboss: SLB839
    Saturday, May 9, 2015 10:38 PM
  • mouse motion analysis tool:VMR034

    calcualtes mouse speed and makes trend of mouse gestures

    graph shows mouse acceleration and directional changes in 1/100 of secs (interval 10 ms)

    constructed as basetool for gesture handling

    usage: press mouse LB and make a simple gesture. after releasing button is displayed recorded line

    interpolated line and graph analyse. use mouse RB to clear screen

    enjoy!  

     
    • Edited by Tryhest Sunday, May 10, 2015 10:07 AM
    Sunday, May 10, 2015 10:06 AM
  • year calendar: ZRZ872

    EU flag and facts: SDJ938


    • Edited by Tryhest Tuesday, May 12, 2015 1:37 PM
    Tuesday, May 12, 2015 1:36 PM
  • Eurosong is coming, some songs info: MNZ671
    Tuesday, May 12, 2015 9:52 PM
  • advanced 3d cubes FZF052
    more speed n options!
    Sunday, May 17, 2015 7:59 AM
  • moon/sun motion VRG084

    use rightmousebutton to adjust opts

    mousewheel fine regulates moon speed

    Monday, May 18, 2015 6:31 AM
  • flickr image analyzer:MFH321

    displays r g b gry cy m y channels and histogram

    Tryhest, nice program.  But it isn't a Turtle program, is it? 

    Nonki Takahashi


    Thursday, May 21, 2015 9:15 AM
    Moderator
  • stage effects:

    KMK250

    also some flags

    XRF562

    use mswheel to adjust gravity/levitation. works only if mouse is on left upper blue box or over flag

    rightclick flag/box to select some of presets flags

    also can paste image from clipboard and make cool flags

    enjoy))


    • Edited by Tryhest Friday, May 22, 2015 8:43 PM
    Thursday, May 21, 2015 10:49 AM
  • Lots of advanced and great power programs here, with coding tricks and usages in SB (incl. LD..), that i did'nt even thing about.

    Would have choosen this one (Calm After The Storm) last yr as for the nice FleetwoodMac/Nicks style.

    And here are the current votes of my SB jury: ... Tryhest 12 points :-)

    Saturday, May 23, 2015 5:07 PM
    Answerer
  • ty pappa L))
    Friday, May 29, 2015 6:30 PM
  • For the C# fans I wrote a simple turtle graphics open-source library: https://github.com/nakov/TurtleGraphics.NET.

    See the demo below:

    C# turtle graphics open-source library - https://github.com/nakov/TurtleGraphics.NET

    And the code behind is very simple:

    // Assign a delay to visualize the drawing process
    Turtle.Delay = 200;
    
    // Draw a equilateral triangle
    Turtle.Rotate(30);
    Turtle.Forward(200);
    Turtle.Rotate(120);
    Turtle.Forward(200);
    Turtle.Rotate(120);
    Turtle.Forward(200);
    
    // Draw a line in the triangle
    Turtle.Rotate(-30);
    Turtle.PenUp();
    Turtle.Backward(50);
    Turtle.PenDown();
    Turtle.Backward(100);
    Turtle.PenUp();
    Turtle.Forward(150);
    Turtle.PenDown();
    Turtle.Rotate(30);

    For simplicity, the C# turtle graphics library is available as NuGet package: https://www.nuget.org/packages/Nakov.TurtleGraphics/.

    Thursday, February 11, 2016 11:26 AM
  • Svetlin, thank you for your information.

    Nonki Takahashi

    Monday, March 7, 2016 7:33 AM
    Moderator