Forum Replies Created
-
AuthorPosts
-
isn’t it…
= new MyExternalClass(“test”)
its what I do, but I haven’t tested it, it might actually be no benefit at all, but benchmarks can often be misleading….
no idea, puzzled, works flawlessly here, with Linux, even once using wine… sadly the error message doesn’t even help – rather odd!
try it in a path without a space ?
okay try this http://www.bedroomcoders.co.uk/tmp/xmp.tar.gz
Look like I forgot I’d changed some stuff, there is a mojo/openal example, on no account should it be used with SDL (audio)
what other sources? and won’t compile gives me no clue with which to help you…
I posted elsewhere a Mersenne (which I eventually fixed!) which I use not for randomness itself (a scatter diagram shows it could be better!) but rather to have a repeatable sequence of numbers (see Elite galaxy generation)
I implemented it in MX2 code so that it should (hopefully) give the same sequence regardless of platform…
just a question
[/crayon]Monkey123[crayon-5cbaa05957f72228632421 inline="true" ]Local awk:=Cast<IBehAwake>( awake )you are casting something to an interface?
… I think he’s writing something he wants you to buy… (hence why p2 is free…)
MX2 is an easy abbreviation M2 is a metric nut size so you’ll just get swamped with irrelevant results…
[/crayon]Monkey123[crayon-5cbaa05962965848493446 inline="true" ]Property thing:Int(); Return _thing; Endisn’t ideal in terms of readability but yeah, there are times when a number of different statement would be neater on a single line – empty extern methods for example.
is there any reason that white space couldn’t be more meaningful to the parser for example
[/crayon]Monkey123[crayon-5cbaa0596296c205447746 inline="true" ]Property thing:Int() Return _thing; Endthere is nothing valid to be had after ) so why not assume the code bock has stated (even on the same line) expressions like the return statement do need some EOL marker because often expressions are more readable with embedded spaces.
BINGO!
basically it was an issue with the order of precidence of operations, obviously things are evaluated differently to C / python….
[/crayon]Monkey1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768[crayon-5cbaa059674e4084248179 inline="true" ]'https://en.wikipedia.org/wiki/Mersenne_TwisterClass MT19937Method New(seed:uint)oldSeed = seedreset()End MethodMethod get:uint()If index >= 624 Then twist()Local y:UInt = mt[index]y = y ~ (y Shr 11)y = y ~ ((y Shl 7) & 2636928640)y = y ~ ((y Shl 15) & 4022730752)y = y ~ (y Shr 18)index = index + 1Return mask(y)End MethodMethod reset()index = 624mt[0] = oldSeedFor Local i:Int = 1 To 624mt[i] = mask(1812433253 * (mt[i-1] ~ (mt[i-1] Shr 30)) + i)NextEnd MethodPrivateField oldSeed:UIntField index:UIntField mt:UInt[] = New uint[625]Method mask:uint(x:UInt)Return $FFFFFFFF & xEnd MethodMethod twist()Local y:UIntFor Local i:Int = 0 To 624y =mask( (mt[i] & $80000000) + (mt[(i+1) Mod 624] & $7fffffff) )mt[i] = mask( mt[(i + 397) Mod 624] ~ y Shr 1 )If (y Mod 2) <> 0 Then mt[i] = mt[i] ~ $9908b0dfNextindex = 0End MethodEnd ClassFunction Main()Local mt:MT19937 = New MT19937(123)#RemFor Local i:Int = 0 To 32Print mt.get()NextPrint "------"mt.reset()#end remFor Local i:Int = 0 To 1024Print mt.get()NextEnd Functionack I was trying it as short must have missed one, sadly that makes no difference to this issue I described? the index type doesn’t seem to be causing the issue either….
out of interest why is bitshifting ugly?
Personally I’d love to see better support for C structs (embedded arrays of stucts in structs for example) and having C++ classes as “first class citizens” so on declaring them external (and providing prototypes – probably in header files) you could then use them as if they were (optionally none GC’d) MX2 classes.
object finalisers would allow module writers to craftily integrate external libraries in a way that would allow safe integration with mx2’s garbage collector, basically by creating shadow lists of children objects for parent objects (thus protecting children until the parent is destroyed) – and there are a number of other corner cases for having finalisers too, although they are not without their potential issues.
I’d also really like to see 3d physics as an “official” mod, but there’s so much for a one person team that I can’t see it happening in a hurry and for now just using a self made tiny subset of bullet for what I need.
@scurty from what I remember a lot of the lower level libs are on the whole C (as opposed to C++) with largely simple structures (if any) – ie no array structs inside structs – infact even xlib is quite straight forward even when accessed directly from (for example) python.
What is this Osx and Windows thing? got anything that can run on my boxes ?
-
AuthorPosts