## Search found 458 matches

Oct 27, 2010 15:34
Forum: Tips and Tricks
Topic: Hash table generator
Replies: 13
Views: 2951
I'd expect this approach to the question to be a fair bit slower since it uses a brute force search, no nifty data structures at all. But that said I'd be interested in knowing how much slower since some of the string functions are pretty fast... It does have the advantage short and simple, if perfo...
Oct 20, 2010 12:36
Forum: Beginners
Topic: Giving up..pulling my hair out
Replies: 15
Views: 1451
I have not done what you are trying to do, so I can't give you the code, but the error msg I assume is because
testing.png
which is your file name needs to be inside quotation marks thus
"testing.png"
Oct 20, 2010 10:33
Forum: Beginners
Topic: Giving up..pulling my hair out
Replies: 15
Views: 1451

### Re: Giving up..pulling my hair out

Hi, Sorry if I come across upset but annoyed to no end. I am just trying to load a .png THATS IT!!! I am not trying to make it dance, circle the globe, talk to darth vader just load on the freaking screen PERIOD!!!!! I have searched the whole site and did every example under the moon and everytime ...
Oct 19, 2010 2:22
Forum: General
Topic: precedence of unary op
Replies: 3
Views: 612
here is the chart for visual basic: Precedence Order Operators are evaluated in the following order of precedence: Arithmetic and Concatenation Operators Exponentiation (^) Unary identity and negation (+, –) Multiplication and floating-point division (*, /) Integer division (\) Modulus arithmetic (M...
Oct 18, 2010 16:56
Forum: General
Topic: Almost Perfectly Rounded Number
Replies: 10
Views: 789
If the float being rounded is x.5 it will round x to the closest even integer. That isn't what it's doing though. It's rounding it 12923. that's because the number being rounded is not 12922.5 but rather 12922.595 In other words bankers rounding is only applied when the fractional portion is 0.5 as...
Oct 18, 2010 16:31
Forum: General
Topic: Almost Perfectly Rounded Number
Replies: 10
Views: 789
@John In the process of that coercion, it doesn't simply truncate the fractional value, it also rounds up, if the number closest to the decimal is greater than or equal to 5. it is actually not quite true to say that "it also rounds up, if the number closest to the decimal is greater than or equal ...
Oct 18, 2010 15:45
Forum: General
Topic: Almost Perfectly Rounded Number
Replies: 10
Views: 789
the bin function has no definition that takes a floating point type as a parameter, only integer types, so when you call it with a floating point value the compiler first coerces that float to an integer value, and that is where the "rounding" occurs. See this example that gives the same results as ...
Oct 18, 2010 14:33
Forum: General
Topic: Read in a file format
Replies: 5
Views: 762
something like this? (not tested) dim s as string dim f as integer = freefile open "somefile.txt" for input as f do line input #f, s loop until (instr("3=", trim(s)) = 1) or eof(f) close f s = trim(s) if (instr("3=",s)...
Oct 17, 2010 3:35
Forum: General
Topic: Need help with pathfinding
Replies: 16
Views: 2700
counting_pine wrote:Perhaps you're looking for code that does the following?
1. Find shortest path
2. Mark all points on path (except start and end) as obstructed
3. If more paths goto 1

That won't find all paths in all cases
Many cases where a longer path will have square(s) in common with a shorter one
Oct 17, 2010 1:29
Forum: General
Topic: Need help with pathfinding
Replies: 16
Views: 2700
Anyone at least having idea how to implement brute force? some things we know about the problem: let dns = the north-south distance between a and b let dwe = the east-west distance between a and b let min = dns + dwe then the shortest possible path between a & b will be at least min moves long....
Oct 16, 2010 16:22
Forum: General
Topic: Need help with pathfinding
Replies: 16
Views: 2700
nothing short of brute force occurs to me off the top of my head, sorry
Oct 16, 2010 15:40
Forum: General
Topic: Need help with pathfinding
Replies: 16
Views: 2700
Your test program seems to generate grids with mostly 5 but sometimes 4 impassible squares, will this always be the case?

I assume that a valid route cannot pass through the same square more than one time, is this correct?
Oct 16, 2010 3:14
Forum: Libraries
Topic: crt.bi docs?
Replies: 3
Views: 1047

### crt.bi docs?

Does anyone know if documentation for crt.bi (and it's various includes) exists? if so where it can be found?

Cheers

John
Oct 15, 2010 1:51
Forum: General
Topic: String Concatenation & vs +
Replies: 3
Views: 1137
If you write 2 test programs, compile with the r switch and look at the asm you will see that + is a synonym for &, they produce the same object code, so there will be no speed difference. That being the case I think there is a strong argument to be made for using & because it increases read...
Oct 13, 2010 18:21
Forum: General
Topic: File I/O String/ZString Trouble
Replies: 4
Views: 819
This works the way you want it to File length is not what it should be if you do it otherwise, but I'm ashamed to admit I can't explain why in detail. It's just the way I have always done it and it works... Type img_attr As Integer set, x, y, w, h As String * 24 id End Type Dim f As String = "f...