Sign in to follow this  
  • entries
    149
  • comments
    510
  • views
    94311

Window to the future

Sign in to follow this  
noaktree

101 views

Floating lists...

The float type is now in my little scripting language. Also I have added support for float arrays. The arrays in my language are currently one dimensional. I think this is no good and will attempt to add either a matrix type or support for multidimensional arrays in a future version.

Hell-of-a-time...

Too make a long story short I'll just say that pointers and STL don't mix well. I wanted to store a data type as a dynamic array of bytes. The problem with this is that A2 types are stored inside of STL vectors and a pointer to an array of bytes doesn't get copied or even noticed with common STL vector operations. I may find an elegant solution to this in the future and thanks to data abstraction should have no problem dropping in a different implementation without affecting too much. Something will need to be done before I can add user defined structs to the language.

A scripting demo...

I'm working on a graphical demo which executes A2 scripts. It will demonstrate different ways you can use A2 in a 2D game environment. And yes tossing Spongebob around with script vectors is included. [smile] What else could I put in the window?

Sign in to follow this  


5 Comments


Recommended Comments

Quote:
The arrays in my language are currently one dimensional.

Not entirely sure how you'd go about implementing it, but if you can allow an array as a basic type that contains any other basic type you could have an array-of-arrays-of-arrays (3D array)...

I'm pretty sure this is how Java implements arrays, maybe C/C++ as well. Although, I think it's only Java that allows you to have "odd shape" arrays:

[0] [1] [2]
[0] = { a , b , c }
[1] = { d , e }
[2] = { f }


Quote:
Too make a long story short I’ll just say that pointers and STL don’t mix well

Agreed. The STL is great, but it can be a real pain in the backside. The thing that always annoys me about it is that I get stuck, look up some guru's book/website and find the solution - upon which it all seems so elegant and simple (as STL is supposed to be) yet I'd never of figured it out on my own [headshake]

Quote:
What else could I put in the window?

Some glass? [lol]

I did see an interpretted script demo once that showed, as a form of log-like output, the script commands as they're executed. Thus you get a sort of flickering of code across the bottom of the screen as all the lines of script get executed... You could slow it down and watch each line as the program worked through it.

It was a bit noisy, but it looked quite cool - almost had that Matrix Code™ effect from the films [grin]

Jack

Share this comment


Link to comment
Quote:
Not entirely sure how you'd go about implementing it, but if you can allow an array as a basic type that contains any other basic type you could have an array-of-arrays-of-arrays (3D array)...
This sounds like the implementation I had in mind from the start. Completely extensible. In order to get it to work I'll need to figure out a better way to store variable memory.

Quote:
Agreed. The STL is great, but it can be a real pain in the backside. The thing that always annoys me about it is that I get stuck, look up some guru's book/website and find the solution - upon which it all seems so elegant and simple (as STL is supposed to be) yet I'd never of figured it out on my own
Yeah I found a guru's vector class that supports pointers but it only works for a list of pointers rather than a struct that may include pointers as well as values. I may just build my own map and vector classes to support what I want to do. But I'll look around for an STL solution first.

Share this comment


Link to comment
Quote:
I may just build my own map and vector classes to support what I want to do. But I'll look around for an STL solution first.

You thought about asking the people in the 'General Programming' forum? I don't spend much time there so I'll of missed it if you do... but everytime I do visit it, they seem to be both helpful and know exactly what they're on about [grin]

Jack

Share this comment


Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now