Search found 332 matches

by Luis Babboni
Jun 16, 2021 14:18
Forum: Beginners
Topic: Can´t open .bas
Replies: 2
Views: 65

Re: Can´t open .bas

Xusinboy Bekchanov wrote:When you save, you will have a different folder open. When saving, click on TP08 and see the path.


Yes!!! Thanks!! Was a Windows missunderstood problem from me, not related with FB! :-)
by Luis Babboni
Jun 16, 2021 11:39
Forum: Beginners
Topic: Can´t open .bas
Replies: 2
Views: 65

Can´t open .bas

Hi. Yesterday I did a programm and save it. Today I could not load it. From "Open file" I could not see it. From Windows I could not see it neither. But from "Save as", yes, it appears. It is the "test mouse flechas.bas" I think could be something related with the space...
by Luis Babboni
Apr 11, 2021 19:15
Forum: Beginners
Topic: Exist a Type for more than one variable?
Replies: 3
Views: 270

Re: Exist a Type for more than one variable?

Types can be nested. type typethingA piece1 as Integer piece2 as integer end type type typethingb piece1 as integer piece2 as integer end type type typearray thingA as typethingA thingB as typethingB end type dim as typearray array(5) array(1).thingA.piece1=10 array(4).thingB.piece2=15 print array(...
by Luis Babboni
Apr 11, 2021 13:41
Forum: Beginners
Topic: Exist a Type for more than one variable?
Replies: 3
Views: 270

Re: Exist a Type for more than one variable?

This is the best I could do. Exists something better? Type ListaMovidas Desde As Integer Hacia As Integer Tipo As Integer Corona As Integer AlPaso As Integer ValorOrden As Integer End Type Dim Shared LM(1 To 100,1 To 500) As ListaMovidas Dim As Integer Profundidad, Movida Profundidad=5 Movida=23 LM(...
by Luis Babboni
Apr 11, 2021 13:31
Forum: Beginners
Topic: Exist a Type for more than one variable?
Replies: 3
Views: 270

Exist a Type for more than one variable?

I´m coming from the Sinclair Spectrum Basic and I use arrays for everything. I discovered something interesting in clarity that is "Type". Instead of Array (1 to 3) I could use: Array.ThingA; Array.ThingB and Array.ThingC What about if I need Array (1 to 2, 1 to 2)? Exist something that al...
by Luis Babboni
Apr 04, 2021 17:22
Forum: Beginners
Topic: Problem adding Ulongint numbers
Replies: 30
Views: 851

Re: Problem adding Ulongint numbers

Don't use ^ with integers. The ^ operator takes 2 doubles as inputs and returns a double. When used with integers, automatic conversion to and from doubles is done. Example: Dim a As ULongInt a=18049651735527936 Print a+2^0 Sleep Prints: 1.804965173552794e+16 Interestingly fbc 32-bit behaves differ...
by Luis Babboni
Apr 04, 2021 17:20
Forum: Beginners
Topic: Problem adding Ulongint numbers
Replies: 30
Views: 851

Re: Problem adding Ulongint numbers

A 64 bits word is used as a chessboard. Fine, but not enough information about the layout. If I assume for instance: field (on chess board) A1 is represented in bit 0 (lowermost bit) then: is bit 1 representative for A2, or B1? e.t.c. while you might know those things, others here don't ... Is my f...
by Luis Babboni
Apr 04, 2021 13:13
Forum: Beginners
Topic: Problem adding Ulongint numbers
Replies: 30
Views: 851

Re: Problem adding Ulongint numbers

Yeah I'm confused too. Why are you doing exponentiation when you're really just after a bit mask. Just use bit shifting. That's what it's there for and CPUs can do it super efficiently with no math. To be clear, say you want to turn on bits x,y, and z. Instead of multiplying out 2 to the powers of ...
by Luis Babboni
Apr 04, 2021 12:26
Forum: Beginners
Topic: Problem adding Ulongint numbers
Replies: 30
Views: 851

Re: Problem adding Ulongint numbers

Wow! Thanks for your time dodicat!

I need time to understand it.
by Luis Babboni
Apr 04, 2021 5:13
Forum: Beginners
Topic: Problem adding Ulongint numbers
Replies: 30
Views: 851

Re: Problem adding Ulongint numbers

As I said, do not matter the time it takes cause it is needed just before start the game. But may be is nicer the way you said. I need to understand it better.
by Luis Babboni
Apr 04, 2021 5:12
Forum: Beginners
Topic: Problem adding Ulongint numbers
Replies: 30
Views: 851

Re: Problem adding Ulongint numbers

Yeah I'm confused too. Why are you doing exponentiation when you're really just after a bit mask. Just use bit shifting. That's what it's there for and CPUs can do it super efficiently with no math. To be clear, say you want to turn on bits x,y, and z. Instead of multiplying out 2 to the powers of ...
by Luis Babboni
Apr 04, 2021 2:30
Forum: Beginners
Topic: Problem adding Ulongint numbers
Replies: 30
Views: 851

Re: Problem adding Ulongint numbers

I need to caclulate it for a bishop in each of the 64 squares of the board and in the 4 directions it could move.
The same for the rook.
by Luis Babboni
Apr 04, 2021 2:28
Forum: Beginners
Topic: Problem adding Ulongint numbers
Replies: 30
Views: 851

Re: Problem adding Ulongint numbers

So I need to calculate 2^x1+2*x2+...+2^xn (where xi are any numbers from 0 to 63) exactly, because if not, that means the bishop could move where it couldnt. Or do not move where it could.
by Luis Babboni
Apr 04, 2021 2:26
Forum: Beginners
Topic: Problem adding Ulongint numbers
Replies: 30
Views: 851

Re: Problem adding Ulongint numbers

I don't really understand what exactly you're after. If it's the maximum value a ULongInt can hold use: Const As ULongInt ULImax = &hFFFFFFFFFFFFFFFF Just print it out to get the DEC equivalent. Sorry, not understand :-( I need to calculate the addition of several 2^x numbers. A 64 bits word is...
by Luis Babboni
Apr 04, 2021 2:16
Forum: Beginners
Topic: Problem adding Ulongint numbers
Replies: 30
Views: 851

Re: Problem adding Ulongint numbers

Seems this works:

Image

Code: Select all

Function POT(ByVal num As Integer)As ULongInt
   Dim i As Integer
   Dim resultado As ULongInt
   resultado=1
   For i=1 To num
      resultado=resultado*2
   Next
   POT=resultado
End Function

Go to advanced search