Search found 225 matches

by gothon
Sep 12, 2015 4:50
Forum: Sources, Examples, Tips and Tricks
Topic: Infinite sprites in pure FreeBasic
Replies: 6
Views: 1801

Re: Infinite sprites in pure FreeBasic

The circle faces are at war! Who will win? ScreenRes 800, 600, 32 Dim Img As Any Ptr = ImageCreate(32, 32, RGBA(255, 0, 255,0)) Circle Img, (16, 16), 15, RGB(255, 255, 0), , , 1, F Circle Img, (10, 10), 3, RGB( 0, 0, 0), , , 2, F Circle Img, (23, 10), 3, RGB( 0, 0, 0), , , 2, F Circle Img, (16, 18),...
by gothon
Jun 01, 2014 20:01
Forum: Community Discussion
Topic: New FB game making competition - interested?
Replies: 12
Views: 2630

Re: New FB game making competition - interested?

Hi Lachie, its good to hear from you. I have a few ideas of experiments I can try doing that use some advanced techniques to make improvements to simple games. I don't know how far I will get, but a competition could help motivate me to get something done. I'm curious to see what theme you will come...
by gothon
May 28, 2014 5:22
Forum: Community Discussion
Topic: are memory streams impossible? (nope!)
Replies: 18
Views: 4472

Re: are memory streams impossible?

It is certainly possible to stream things in memory. The best way of going about it will depend on what you need to accomplish. If you only need to handle string data, you can use string handling methods. If you need to stream data of arbitrary type, you can get the memory size of the data using the...
by gothon
May 27, 2014 22:42
Forum: Beginners
Topic: Squares??
Replies: 11
Views: 1826

Re: Squares??

With the FreeBASIC graphics you can easily draw axis aligned squares (and rectangles), by passing the quirk parameter 'B' (which stands for 'box') to the line command. You can even have a filled square or box by passing 'BF'. ScreenRes 640, 480, 32 Line (100, 100)-(200, 200), , B Line (250, 100)-(35...
by gothon
May 20, 2014 3:39
Forum: Sources, Examples, Tips and Tricks
Topic: Binary "neural" network
Replies: 17
Views: 4807

Re: Binary "neural" network

I don't know much about analog computing. I think that it would be acceptable for the computations to be analog, as long as the programs are still digital. I don't know how someone would design the right kind of hybrid system enabling digital programming of an analog system. The reason I insist the ...
by gothon
May 18, 2014 6:45
Forum: Sources, Examples, Tips and Tricks
Topic: Binary "neural" network
Replies: 17
Views: 4807

Re: Binary "neural" network

Compiler output error, I probably don't have the latest FreeBasic compiler, error 3: Expected End-of-Line, found '(' in '#If SizeOf(Integer) = 8' Sorry I didn't realize that SizeOf can't be used inside of a pre-processor #If in fbc versions older than 0.90.0. I'm not aware of any way of distinguish...
by gothon
May 18, 2014 2:53
Forum: Sources, Examples, Tips and Tricks
Topic: Binary "neural" network
Replies: 17
Views: 4807

Re: Binary "neural" network

I got to thinking about this, and it should be possible to compute a network like this more efficiently on a CPU by grouping neurons into word sized 'clusters'. This way the CPU can process a whole cluster of neurons in parallel using a single word sized operation. In what follows, I made a version ...
by gothon
May 11, 2014 23:56
Forum: Beginners
Topic: A Star Pathfinding Problem
Replies: 3
Views: 848

Re: A Star Pathfinding Problem

Have you tried compiling with -exx? CompilerOptexx

I am getting:
Aborting due to runtime error 6 (out of bounds array access) at line 166 of PathFinding.bas::GETGSCORE()

Code: Select all

        If matrix(a.x,a.y) = notWalkable Then 'a.x = -1 here
            score = 10
        EndIf
by gothon
May 06, 2014 7:22
Forum: General
Topic: retrieving the random seed
Replies: 7
Views: 1577

Re: retrieving the random seed

From what I understand, calling the timer is redundant. RANDOMIZE itself generates unique outputs each run, right? Yes, that is correct. Although the redundancy is only in the 6 characters of extra code it takes to write it out, since according to the documentation Randomize uses Timer to produce t...
by gothon
May 02, 2014 5:15
Forum: Sources, Examples, Tips and Tricks
Topic: Binary "neural" network
Replies: 17
Views: 4807

Re: Binary "neural" network

This is a neat little model of computation you have here. Interesting to watch random networks go into semi-stable and periodic loops. I have noticed some inconsistencies in the code. type NEURON as integer i(4) 'four inputs as integer w(4) 'four weights for each input as integer c(4) 'neuron number...
by gothon
Apr 27, 2014 4:05
Forum: General
Topic: Can you overload []
Replies: 2
Views: 393

Re: Can you overload []

From changelog.txt in the unreleased version 0.91.0: [added] ... - operator [] overloading support, for example: type MyStringClass : declare operator []( index as integer ) byref as integer : ... Example: #If __FB_VERSION__ < "0.91.0" #Error FB Version 0.91 or higher needed! #EndIf Type V...
by gothon
Apr 25, 2014 5:50
Forum: Community Discussion
Topic: dim as something array(any)
Replies: 4
Views: 851

Re: dim as something array(any)

I thought since so much discussion has been going on surrounding the new varlen UDT arrays, it might be nice to have a separate topic. The following appears to be a bug.. type node dim as string key dim as any ptr value end type type list as node nodes(any) end type dim as list l1 redim l1.nodes(0)...
by gothon
Apr 22, 2014 16:50
Forum: General
Topic: Genetic Programming
Replies: 50
Views: 10343

Re: Genetic Programming

this was created by me to control robots there is a 'game' called robocode were two tanks try to shoot eats other to play this game you write a program that contols a tank i had no idea how to write a program for thtat so i decided to use the computer for that This is a good use of GP. In a game it...
by gothon
Apr 18, 2014 21:50
Forum: General
Topic: Genetic Programming
Replies: 50
Views: 10343

Re: Genetic Programming

Obviously too brilliant for the journalists who wrote about it, and I never figured out how it was better than sitting down and writing the program yourself, or employing an infinite number of monkeys. It will not produce a better program, nor will it produce it very quickly, but it will produce a ...
by gothon
Apr 10, 2014 9:36
Forum: Beginners
Topic: string is very convenient, but do not support UNICODE
Replies: 5
Views: 2644

Re: string is very convenient, but do not support UNICODE

Code saved as UNICODE is probably UTF16, so use I used WString, which is 2 bytes per character and was able to get correct output from MessageBox.

Code: Select all

#Define UNICODE
#Include "windows.bi"

Dim As WString Ptr text = @"你好世界"
?*text
MessageBox(0,text,"",MB_OK)