Войти в систему

Home
    - Создать дневник
    - Написать в дневник
       - Подробный режим

LJ.Rossia.org
    - Новости сайта
    - Общие настройки
    - Sitemap
    - Оплата
    - ljr-fif

Редактировать...
    - Настройки
    - Список друзей
    - Дневник
    - Картинки
    - Пароль
    - Вид дневника

Сообщества

Настроить S2

Помощь
    - Забыли пароль?
    - FAQ
    - Тех. поддержка



Пишет sadkov ([info]sadkov)
@ 2019-09-04 21:44:00


Previous Entry  Add to memories!  Tell a Friend!  Next Entry
Настроение: amused
Entry tags:gamedev

XOR
Didn't knew one can use XOR to quickly make permutations:
https://crypto.stackexchange.com/questions/60147/reproducable-pseudorandom-permutation

and they also say XOR is related to factorials (usual way to get permutations: https://medium.com/@aiswaryamathur/find-the-n-th-permutation-of-an-ordered-string-using-factorial-number-system-9c81e34ab0c8 ). Guess everything is related to everything in the end. Anyway, I'm trying to make my shuffle function more efficient. Currently it calls rand for each element, which is, well, slow. Ideally, I need to generate one random number, which would pick the desired permutation.


list.shuffle =
| Xs = $copy
| N = Xs.size
| while N > 1
  | N--
  | R = N.rand
  | X = Xs.R
  | Xs.R <= Xs.N
  | Xs.N <= X
| Xs


(Добавить комментарий)


(Анонимно)
2019-09-05 08:59 (ссылка)
I don't know why you continue doing that when you can launch Unreal Engine and create any type of games. It is now is not old doom times when you haven't choice what to use.

Seems like Ketmar symptom.

(Ответить) (Ветвь дискуссии)


[info]sadkov
2019-09-05 10:29 (ссылка)
My computer is too slow to run Unreal engine.

(Ответить) (Уровень выше)

Another day of sadkov
(Анонимно)
2019-09-05 09:38 (ссылка)
How many years you plannig make own game? It's not rational position at all.

If you wish to game can be launched everywhere then need realize browser support. Browser works almost on any system.

(Ответить) (Ветвь дискуссии)

Re: Another day of sadkov
[info]sadkov
2019-09-05 10:30 (ссылка)
Browsers are too slow for software rendering.

(Ответить) (Уровень выше)