Page of 410

 

i really didnt want to have to make a devforum post, but after an entire day of 
having no idea what to do this is practically my last resort.the title might be 
slightly confusing, so let me elaborateim currently working on a roblox port of 
the website library of babel. its basically a website that contains  randomly ge
nerated books practically anything you can write in english, its on this website
, including this devforum page. its able to contain this amount of books as inst
ead of storing them, they can be retrieved by using a random number generator, a
nd using the hex, wall, shelf, and volume as a seed, then using that to randomly
 generate  characters for  pages.i already got the main part  randomly generatin
g the books title and contents with a linear congruential generator, but im miss
ing one of the core features of the library of babel the search feature.im prett
y sure the search feature in the library of babel works by getting the seed of t
he book that would generate that exact line of text and giving you the address o
f that book.problem is, i have no idea how to do this in lua or any other langua
ge for that matter, though i know its possible, as the library of babel is a liv
ing testimony to this.the current code im using to generate random numbers islin
earcongruentialgenerator  linearcongruentialgenerator.index  linearcongruentialg
eneratorfunction linearcongruentialgeneratorrandoma, blocal y  self.a  self.x  s
elf.c  self.mself.x  yif not a then return y  xelseif not b thenif a   then retu
rn yelse return   y  a endelsereturn a  y  b  a  endendfunction lcgs, rlocal tem
p  setmetatabletemp, linearcongruentialgeneratortemp.a, temp.c, temp.m  , , x  f
rom ansi cif r thenif r  nr then temp.a, temp.c, temp.m  , , x from numerical re
cipes.elseif r  mvc then temp.a, temp.c, temp.m  , , x endfrom mvcendtemprandoms
eedsreturn tempendis there anyway i could feed a function an array of results, a
nd have it return a seed that would result in those exact results, or is there a
lready an opensourced random number generator for lua that can already do someth
ing like thatif you need me to elaborate more, just tell me. its a really confus
ing and specific question, so i understand                                      
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                

 

<< < Random Page > >>

 


Book Location: 3938vwlavy6hwcvyldrdc4g1olxf9a31h2p1h6714v...-w1-s1-v26

Single Page | Anglishize | Bookmarkable | Download | Home