# π’ B4XTurtle - Library for teachers and parents

Longtime User

Longtime User

#### Erel

##### B4X founder
Staff member
Longtime User
Semi-solution:
B4X:
``````Sub DrawWave
For i = 1 To 10000
Turtle.MoveForward(0.1).TurnLeft(CosD(i))
Next
End Sub``````

#### LucaMs

##### Expert
Longtime User
Semi-solution:
B4X:
``````Sub DrawWave
For i = 1 To 10000
Turtle.MoveForward(0.1).TurnLeft(CosD(i))
Next
End Sub``````
Just playing, without thinking (but sleeping ), I tried to add the ray:
B4X:
``````Sub DrawWave(r As Float)
Turtle.SetX(10).SetAngle(0).SetSpeedFactor(2)
'    For i = 1 To Turtle.Width - 20
For i = 1 To 5000
'        Turtle.MoveForward(0.1).TurnLeft(CosD(i))
Turtle.MoveForward(1).TurnLeft(CosD(i) * r)
Next
End Sub``````
Result?

#### rabbitBUSH

##### Well-Known Member
I think you guys have been in LOCKDOWN too long : you're going in circles . . . .

at least if these were squares you could measure the paces from one corner of the lounge to the other to the other to the other to the other to the other [recursive]

I think you need to get my lockdown converter from that other post last week - you'll see a nominal time to lease from the circular motion (is it Brownian Motion I wonder)...

PS it took me a long time to remember how to calculate the area of a circle yesterday : so as they say in Dragons Den "I'm Out".

#### rabbitBUSH

##### Well-Known Member
B4Xers : Your next mission challenge, should you decide to accept it Mr Hunt, is to simulate Brownian Motion using Turtle Library from @Erel in Isreal. This message will self destruct in moments.

Because he has been appointed official Judge of the best solution @Erel is disqualified (and he ALSO has the inside track on use of the library ).

The hero gets to run away with the lead actress / actor - (still to be cast in the role - suggestions welcome)
or

#### Erel

##### B4X founder
Staff member
Longtime User
Update:
v1.02 - Fill, Arc and RandomColor

#### Erel

##### B4X founder
Staff member
Longtime User
v1.03 - Multiple layers and other improvements.

#### Erel

##### B4X founder
Staff member
Longtime User
v1.04 - Fixes an issue with Fill which can cause the program to hang.

#### Erel

##### B4X founder
Staff member
Longtime User
v1.05 - Fixes an issue where the turtle could disappear when moving outside of the visible area, instead of appearing on the other side.

#### JoeInvestiga

##### Member
Sub Process_Globals
Private fx As JFX
Private MainForm As Form
Private xui As XUI 'ignore
Private Turtle As B4XTurtle
End Sub

Which is it the Libraries for: Private Turtle As B4XTurtle. Because in code is Error. And, en other lines too.
Libraries used: JCore (Version 7.51); JFX (Version 7.50); XUI views (Version 2.23)

Thanks.

#### Erel

##### B4X founder
Staff member
Longtime User
The library is attached for the first post: B4XTable.b4xlib. You need to configure the "additional libraries folder" under Tools - Configure Paths and put it there.

In the future it will be an internal library.

Longtime User

#### LucaMs

##### Expert
Longtime User
If you want to create a "real" game then use XUI2D.
No, no games or apps. As I wrote, I have an extravagant idea to "apply" to your turtle.
Perhaps what you have indicated may suffice.

Thank you.

ARGB: 255, 255, 254, 254 (cat color, on white background)

Last edited:

#### Blueforcer

##### Well-Known Member
Longtime User
Funny Lib!
I haven't found a special usecase yet, but the Gcode of a 3D printer came directly to my mind and i created a gcode reader/simulator (very Quick&Dirty and may crash with different Slicers)

#### Attachments

• GcodeSimulator.zip
2.9 KB · Views: 227
Last edited:

#### sorex

##### Expert
Longtime User
I didn't had the time yet to have a look at this retro style programming/drawing tool.

But as I had to wait for some stuff to complete at work I though I'd give it a try.

It's easy to use even for regular drawings and the rabbit mode is extremely fast.

here's another example of what can be done with it... backflipper

only using rabbitmode,clearscreen,setPenSize,setPenColor,penUp,penDown,setX,setY,moveTo in an endless loop with sleep(1000/60) in it

Last edited:

#### Erel

##### B4X founder
Staff member
Longtime User
here's another example of what can be done with it
This is impossible. Post the code.

#### Star-Dust

##### Expert
I didn't had the time yet to have a look at this retro style programming/drawing tool.

But as I had to wait for some stuff to complete at work I though I'd give it a try.

It's easy to use even for regular drawings and the rabbit mode is extremely fast.

here's another example of what can be done with it... backflipper

only using rabbitmode,clearscreen,setPenSize,setPenColor,penUp,penDown,setX,setY,moveTo in an endless loop with sleep(1000/60) in it

View attachment 94740
It looks like my 3D library

Replies
41
Views
14K
Replies
2
Views
3K
Replies
14
Views
4K
Replies
23
Views
4K