Search found 2923 matches

by Tourist Trap
Oct 25, 2020 17:05
Forum: Game Dev
Topic: 4Balls another sliding block puzzle
Replies: 6
Views: 538

Re: 4Balls another sliding block puzzle

3622 wrote:Right click on coloured piece and drag to move. Black indicates an empty space. You can only move into an empty space.

Thank you. I did it in 199 moves. To place the last ball, we must leave the opposite ball out of its hole. It took me too much moves to figure it out. Nice game again :)
by Tourist Trap
Oct 25, 2020 15:56
Forum: Community Discussion
Topic: [solved] Simple math question ?
Replies: 7
Views: 236

Re: [solved] Simple math question ?

Hi, good find Joshy. You were right, both expressions below are very close (the very small difference will vanish with x becoming big) : .5*sqr(1+8*x) = sqr(2*x) Weird but true. for x as integer = 1 to 1000000 if (.5*(1+sqr(1+8*x)) - sqr(2*x) - .5)>0.04 then print "x=";x, "diff="...
by Tourist Trap
Oct 25, 2020 15:43
Forum: Documentation
Topic: Int() and CInt(), unclear sometimes
Replies: 2
Views: 58

Re: Int() and CInt(), unclear sometimes

If the argument is a string expression, it is converted to numeric by using ValInt or ValLng, depending on the size of the result type. Perhaps this sentence is too synthetic but it is nevertheless exact and precise: - If the result type (an Integer) is 32-bit sized, Cint is converted to numeric by...
by Tourist Trap
Oct 25, 2020 14:22
Forum: Documentation
Topic: Int() and CInt(), unclear sometimes
Replies: 2
Views: 58

Int() and CInt(), unclear sometimes

Hi, I understand that INT and CINT dont round a double value the same way. One is rounding to the floor value, the other to nearest integer value. For instance : ? int(6324.555320336759) ' = 6324 ? cint(6324.555320336759) ' = 6325 'not like INT There is something more confusing now. When we use CINT...
by Tourist Trap
Oct 23, 2020 19:31
Forum: Game Dev
Topic: 4Balls another sliding block puzzle
Replies: 6
Views: 538

Re: 4Balls another sliding block puzzle

I don't understand how you make anything move here. I made click and keyboard inputs, nothing moves. Can be kind and give a hint?
by Tourist Trap
Oct 23, 2020 18:41
Forum: Beginners
Topic: Control Slider
Replies: 4
Views: 158

Re: Control Slider

Can someone help me with this uncertainty ...? Hi Gugutsu, you can easily find many sliders objects in various contexts if you type SLIDER in the search bar. For instance, I grabbed this from Albert that implements many win32 controls by the way: https://www.freebasic.net/forum/viewtopic.php?p=2295...
by Tourist Trap
Oct 23, 2020 16:49
Forum: Beginners
Topic: [help] converting code from python to FB
Replies: 43
Views: 1124

Re: [help] converting code from python to FB

But, for the case where the object is already constructed at the provided address, a simple pointer assignment is sufficient: dataset._p2ptr = @pp(0) ( 'dataset._p2ptr = new (@pp(0)) P2' (any)' is more complex but does nothing more) Hi fxm, ANY is mandato...
by Tourist Trap
Oct 23, 2020 16:39
Forum: Community Discussion
Topic: [solved] Simple math question ?
Replies: 7
Views: 236

Re: [solved] Simple math question ?

That's not as trivial as I thought to visualise this stuff. Maybe by a plot in 3D such similar to as below.
Here is when x = n^2/2
Image
by Tourist Trap
Oct 23, 2020 14:28
Forum: Beginners
Topic: [help] converting code from python to FB
Replies: 43
Views: 1124

Re: [help] converting code from python to FB

For me, your code can at first be simply resume to: type P2 declare operator []( byval index As integer ) byref As double as double _d(1 to 2) end type operator P2.[]( byval index As integer ) byref As double return This._d(index) end operator dim as P2 pp(9) for i as integer = 0 to uBound(pp) pp(i...
by Tourist Trap
Oct 23, 2020 13:46
Forum: Community Discussion
Topic: [solved] Simple math question ?
Replies: 7
Views: 236

Re: Simple math question ?

According to Maxima:
Image

More specifically for your x = 20000000 :
Image
by Tourist Trap
Oct 23, 2020 13:18
Forum: Beginners
Topic: [help] converting code from python to FB
Replies: 43
Views: 1124

Re: [help] converting code from python to FB

Ok, but under the hood, we can just use an array of Double (instead of an array of pointer + New/Delete), inducing a structure simpler than above, while keeping the same interfacing for user with square brackets. Thanks. Then I ended mixing the things up a little bit, this way : type P2 declare ope...
by Tourist Trap
Oct 22, 2020 16:41
Forum: Beginners
Topic: [help] converting code from python to FB
Replies: 43
Views: 1124

Re: [help] converting code from python to FB

Ok so this below is something that should work to get the square brackets instead of the rounded ones: type P2 declare constructor() declare destructor() declare operator []( byval index As integer ) byref As double as double ptr _dptr(1 to 2) end type constructor P2() this._dptr(1) = new double(1) ...
by Tourist Trap
Oct 22, 2020 15:07
Forum: Beginners
Topic: [help] converting code from python to FB
Replies: 43
Views: 1124

Re: [help] converting code from python to FB

hi tourist trap.. added you to the repository as collaborator check your e-mail :) ron77 Done, thanks. I'm right now looking at overloading the operator [ ] from inside a UDT. Maybe it will be the best way to mimic python syntax when passing and using the dataset variable. https://www.freebasic.net...
by Tourist Trap
Oct 22, 2020 14:44
Forum: Beginners
Topic: [help] converting code from python to FB
Replies: 43
Views: 1124

Re: [help] converting code from python to FB

ron77 wrote:do you have a github account and if so by what nick name?

Thanks. Then you can find my Github account under the name : @trapmania. Should be still alive.
by Tourist Trap
Oct 22, 2020 14:23
Forum: Beginners
Topic: [help] converting code from python to FB
Replies: 43
Views: 1124

Re: [help] converting code from python to FB

hi tourist trap... i've looked at the first draft code i was working on and i will now give here what i think we can extract from the old code to the new... i mean mostly equations function i have already successfully converted to FB... so here is what i got so far: 'fb code ' Calculate the mean va...

Go to advanced search