domingo, 20 de marzo de 2016

Al fin de vuelta a trabajar! | Finally back to work!

Español | English

Finalmente pude crear un hueco en el que pude trabajar en mi proyecto, decidí enfocarme en solo 1 aspecto para resolver ya que tengo que seguir estudiando, por lo que elegí arreglar la aleatoriedad de las opciones que se muestran en los mini-juegos.

El problema: Ya hablado varias veces, el problema era que siempre se mostraban las mismas respuestas en los mismos lugares. Lo que quería hacer era modificar la función que asigna las posiciones para que cada opción sea única, pero esto no era posible (o no he encontrado la forma) ya que se trataba de un ciclo For, por lo que no podía tratar a las opciones por separado sino que todas juntas.

La mejor opción que se me ocurrió (que era la solución que esperaba evadir) fue de crear una función que evalúe a cada opción, en caso de que la opción A sea igual a la opción B, que la opción A se genere devuelta y así para todas las opciones.

No quería utilizar este método ya que tanto escribirlo y como procesarlo es largo, ya que son varias estructuras If, por lo que traté de evadirlo lo más que pude pero al final resultó ser el método más efectivo para solucionar este problema. Ahora el resultado es como planeaba, las opciones se muestran en posiciones aleatorias cada vez que se abre el mini-juego.

-L

---------------------------------------------------------------------------------------
English

Finally I could create a gap where I could work on my project, I decided to focus in only 1 aspect to solve as I have to keep on studying, so I decided to fix the randomness of the displayed options of the mini-games.

The problem: As I've mentioned several times , the problem was that the same options were displayed on the same positions. What I wanted to do was to modify the function that assigns the positions to each option so each option is unique, but I this wan't posible (or I hadn't find the way) as I was dealing with a For function, so I couldn't treat the options separately but all together.

The best option that ocurred to me (which I was trying to avoid) was to create a function that evaluates each position, in case that option A is the same as option B, option A will be generated again and so on for every option.

I didn't want to use this method because both writing it and process it is long, as they are several If structures, that's why I tried to avoid it the most I could but it in the end it turn out to be the most effective method to solve this problem. Now the result is what I've planned, the options are shown in random positions every time the mini-game is started.

-L

No hay comentarios.:

Publicar un comentario