Search found 229 matches

by RockTheSchock
Jan 11, 2009 12:48
Forum: Projects
Topic: A Simple but Interesting Pattern Producer
Replies: 8
Views: 2070

Bit Operations

Probably you can speed up the calculations with bit boards and operations. In chess programms this is generally used. Here is an example with "Conway's Game of Life", too.

http://www.onjava.com/pub/a/onjava/2005/02/02/bitsets.html?page=2
by RockTheSchock
Apr 17, 2008 20:59
Forum: General
Topic: Assigning String Constants to Ubyte Arrays
Replies: 5
Views: 1202

Assigning String Constants to Ubyte Arrays

Type foo signature(5) as UByte Declare Constructor() End Type Constructor foo this.signature(0) = asc("a") this.signature(1) = asc("a") this.signature(2) = asc("a") this.signature(3) = asc(&quo...
by RockTheSchock
Feb 15, 2008 8:45
Forum: General
Topic: [solved] how can i do this?
Replies: 2
Views: 863

use static subs

You must use static member subs Type class_t Declare Constructor Private: Declare Static Sub test0 ' 3 methods (later i need 13) Declare Static Sub test1 Declare Static Sub test2 As Integer abc As Sub() subs(9) ' 9 references on the 3 methods (later i need 255) End Ty...
by RockTheSchock
Dec 13, 2007 12:00
Forum: Tips and Tricks
Topic: FreeBasic interpreter?
Replies: 42
Views: 19384

Emitter as Interpreter

Is it possible to use an FB Emitter as Interpreter? This way it should be easier to make it 99% percent compatble with FreeBasic. Victor is working on a C Emitter. Perhaps he could make a Documentation how to write an Emitter. There are then some possibilities. - Emitter as direct interpreter. - Emi...
by RockTheSchock
Dec 07, 2007 13:38
Forum: General
Topic: How to compare pairs of integers?[solved]
Replies: 12
Views: 2548

Faster compare with asm

On my p3 my version runs faster: cycles 49 - 16 - 13 Dim As Integer a=2,b=1,j=1,k=2 Screen 0 counter_begin( 1000, HIGH_PRIORITY_CLASS ) if ((a=j) and (b=k)) or ((a=k) and (b=j)) Then asm nop End If counter_end Print counter_cycles; " cycle...
by RockTheSchock
Nov 23, 2007 17:17
Forum: General
Topic: have a whack at improving my arraybuffer_add sub
Replies: 9
Views: 2110

I don't understand your code

Sorry, but what does your code? I guess, it's only extending the Array if it's needed. Why you don't use a linked list of arrays and from time to time you make one bigger Array copying and erasing the others in the linked list. If you use OOP you could implement some cool things overloading operators.
by RockTheSchock
Nov 23, 2007 15:21
Forum: Beginners
Topic: Shared or reallocating : Wich is faster?
Replies: 13
Views: 3117

Initialising Array with Any

Try this to initialise array to any. Dim a(9) As Integer => Any It seems to work. This little testcode shows that it works with dynamic arrays to and even with Redim Preserve Dim i As Integer Dim As Integer Ptr pa,pb ReDim b(9) As Integer For i = LBound(b) To UBound(b) b(...
by RockTheSchock
Nov 17, 2007 14:52
Forum: General
Topic: Swapping an array
Replies: 10
Views: 2626

Better Version of swaparrays macro

#Macro SwapArrays(arr,arr2) Scope #If ( TypeOf(arr)=TypeOf(arr2) ) Asm lea eax,[a] 'the adress of the array descriptor begins lea ebx,[b] 'at [a-32]. Begin to swap at the tail 'of the array descriptor mov ecx,8 '32 bytes 8 * dword swaploop: 'swap array descriptors mo...
by RockTheSchock
Nov 17, 2007 4:29
Forum: General
Topic: Swapping an array
Replies: 10
Views: 2626

Macro swapping Arrays

I am tired after 5 hours. I think it works without problems. I know that calling memcopy is ugly but it's 5am. After sleeping i will code this little step. Perhaps there will be someone else finished first. #Include "crt.bi" #Macro SwapArrays(arr,arr2) Scope #If ( TypeOf(ar...
by RockTheSchock
Nov 16, 2007 14:25
Forum: General
Topic: Swapping an array
Replies: 10
Views: 2626

Swapping an array

I want to swap an array wether array1 = array2 nor swap(array1,array2) are working i don't want to copy the arrays, I only want to swap the array descriptors ReDim newlist(1000) As String ReDim filelist(1000) As String Dim changed As String getFiles("*.*",&h21, file...
by RockTheSchock
Nov 13, 2007 14:43
Forum: Game Dev
Topic: Game Development: Square One
Replies: 19
Views: 8657

I've never Programmed an RPG because there are so many of them. But I've a guideline for you. Perhaps you know this stuff yet 1. Seperate game logic and data from output and design. 2. Make thinks as easy and short as possible AND easy to extend 3. If you have never done something make a plan. If yo...
by RockTheSchock
Oct 11, 2007 20:45
Forum: General
Topic: Using Eclipse SWT with FreeBasic
Replies: 1
Views: 1158

Using Eclipse SWT with FreeBasic

The SWT is used by some Java applications like Eclipse as WindowingToolkit. it's like wxWidgets. It should have on all Plattforms the same features like Buttons,TextAreas Labels etc. If one is missing for a specific plattform it is emulated there. There exists a static compiled version. http://www.t...
by RockTheSchock
Sep 20, 2007 12:20
Forum: General
Topic: generate new functions at runtime?
Replies: 10
Views: 3117

dll Generation at runtime

You can generate with the freebasic compiler dll's and include them dynamically at runtime. But you must bundle your software with the FBCompiler and then your Software has to be put under GPL, too, if it depends on that feature. (I am not totally sure if this interpretation of the GPL is right.) Th...
by RockTheSchock
Jun 09, 2007 14:55
Forum: General
Topic: smallest .exe file sizes
Replies: 16
Views: 4578

4,956 Byte Hello World Programm with PDQ.LIB

Does anyone know this lib for QuickBasic. http://www.ethanwiner.com/p_pdq.htm It would be nice if someone asks Ethan Winer if he publishes the code under GPL. .EXE File Size Comparisons P.D.Q. QC 2.0 TC 2.0 TP 5.5 QB 4.5 NumOff Utility 418 2,371 990 2,845 10,325 Hello Program 754 5,363 3,958 3,260 1...

Go to advanced search