The whole main game kind of works

This commit is contained in:
Eric Fredricksen committed 2010-06-25 13:20:37 -07:00
1 parent 747b64675d
commit 0341b5bff1
6 files changed
+263 -270

No files matched your search

+20 -1
View File
@@ -1,4 +1,4 @@
// TODO These code bits don't really belong here.
// TODO These code bits don't really belong here, but this is the only shared bit of js
var randseed = Math.floor(Math.random() * 0xFFFFFFFF);
@@ -15,6 +15,25 @@ function Rand32Rough() {
return (randseed = X % T32);
}
function GenerateName() {
var KParts = [
'br|cr|dr|fr|gr|j|kr|l|m|n|pr||||r|sh|tr|v|wh|x|y|z',
'a|a|e|e|i|i|o|o|u|u|ae|ie|oo|ou',
'b|ck|d|g|k|m|n|p|t|v|x|z'];
function Pick(s) {
var count = 1;
for (var i = 0; i < s.length; ++i)
if (s[i] == '|') ++count;
return s.split("|")[Random(count)];
}
var result = '';
for (var i = 0; i <= 5; ++i)
result += Pick(KParts[i % 3]);
return result.charAt(0).toUpperCase() + result.slice(1);
}
var K = {};