GAP 4.8.9 installation with standard packages -- copy to your CoCalc project to get it
//1// randomize_complex.cpp2// Bistellar3//4// Created by Alexander Thumm on 19.10.11.5// Copyright 2011 -. All rights reserved.6//78#include "randomize_complex.h"910#include <stdlib.h>11#include <time.h>1213void randomize_complex(MovableComplex & complex, const std::vector< unsigned int > & allowedMoves, unsigned int rounds)14{15// initialize the RNG16srand(static_cast<unsigned int>(time(0)));1718for (int currentRound = 0; currentRound < rounds; currentRound++)19{20int numberOfCodimensions = 0;21for (int i = 0; i < allowedMoves.size(); i++)22{23if (complex.hasValidMoves(allowedMoves[i]))24numberOfCodimensions++;25}2627if (numberOfCodimensions == 0)28break;2930int codimension = 0;31for (int i = 0, r = rand() % numberOfCodimensions; i < allowedMoves.size() && r >= 0; i++)32{33if (complex.hasValidMoves(allowedMoves[i]))34{35codimension = allowedMoves[i];36r--;37}38}3940bistellar_move_list_t validMoves = complex.validMoves(codimension);41BistellarMove move = validMoves.at(rand() % validMoves.size());42complex.moveComplex(move);43}44}4546