04 March 2014

Schedule Flash Application

First, I'll start with some simple code. I need two smaller helper functions. First one is clone function since I need to hard-copy entire arrays and this can't be done with built-in functions. Clone function uses ByteArray to hard-copy any array.

Another helper function is createArray which outputs Array with numbers 1 to limit. This is simpler version of application where I only have numbers representing group members. In real life example I'll probably have list of students in text file or something like that so my Array will contain these names. 

Idea is to create application which will split group members into random subgroups will given number of elements (students). This will save time for teachers and make group exercises more interesting because groups are chosen randomly every time.

Main schedule function is simple, I just take one by one element from starter Array created using createArray function, put it in new multidimensional array and exclude it from starting one. I do this until first array is not empty.

This code will work without mistake only if remainder of n / g is zero. If it's not zero, code needs to be modified so extra elements are put in already existing groups, but equally.

Next will be to add some nice graphics around it, maybe some kind of slot machine, anything that looks like group members are selected randomly.




template by blogger templates