mirror of
https://github.com/RussellChamp/tilde-projects.git
synced 2026-10-28 00:22:34 +00:00
First tilde projects commit
This commit is contained in:
1 parent
9bcadfc4a7
commit
726861fae6
40 files changed
+20890
No files matched your search
@@ -0,0 +1,15 @@
|
||||
<head>
|
||||
<title>tilde.town ~dorf fortress!!</title>
|
||||
<style>body{color:white;}</style>
|
||||
</head>
|
||||
<body bgcolor="#000" font-color="#fff">
|
||||
<center>
|
||||
<img src="http://40.media.tumblr.com/fe7375a3f9a3c169aa70b46791f23251/tumblr_mmni19vFVn1rkg8q5o1_r1_500.png" />
|
||||
</center>
|
||||
|
||||
<p>it's the tilde.town dwarf fortress succession game!</p>
|
||||
<h2>sign up!!!!</h2>
|
||||
<p>drop ~jumblesale an email</p>
|
||||
<p><em>strike the earth!</em></p>
|
||||
|
||||
</body>
|
||||
@@ -0,0 +1,12 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>WIP</title>
|
||||
</head>
|
||||
<body>
|
||||
<h2>I just clobbered my index.html file</h2>
|
||||
<h3>New site some time soon</h3>
|
||||
<ul>
|
||||
<li><a href="twine2/">Twine 2.0</a></li>
|
||||
<li><a href="mission/">Mission name generator</a></li>
|
||||
</ul>
|
||||
</body>
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"data1": "foo",
|
||||
"data2": "bar",
|
||||
"data3": ["foo","bar","baz"]
|
||||
};
|
||||
@@ -0,0 +1,15 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Secret Mission Name Generator</title>
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0/angular.min.js"></script>
|
||||
<script src="./js/lodash.js"></script>
|
||||
<script src="./js/mission.js"></script>
|
||||
</head>
|
||||
<body ng-app="MissionApp">
|
||||
<div ng-controller="MissionController as m">
|
||||
<label>Click for a super secret mission name:</label>
|
||||
<input type="button" ng-click="name = m.getMissionName();" ng-init="name=''" value="Get Mission Name"/>
|
||||
<div><h3><em>{{name}}</em><h3></div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,72 @@
|
||||
(function(angular) {
|
||||
'use strict';
|
||||
|
||||
angular.module('MissionApp',[]);
|
||||
|
||||
function MissionController() {
|
||||
|
||||
var self = this;
|
||||
|
||||
var adjectives = Array('Bold','Breaking','Brilliant','Crescent','Dark|Darkness','Desert|Desert','Evening|Darkness','Final','First','July','Last','Libery|Liberty','Magic|Magic','Morning|Morning','Power|Power','Phantom','Present','Roaring|Roar|Scream','Rolling','Sand','Screaming','Soaring','Standing|Stand','Star|Star','Urgent','Utopian','Valiant');
|
||||
var nouns = Array('Action','Alert','Beauty','Claw','Darkness','Dawn','Day','Desert','Envy','Fall','Fist','Flight','Fury','Guard','Hammer','Hand','Honor','Hope','Hurricane','Liberty','Light','Lightning','Magic','Morning','October','Power','Rain','Repose','Roar','Scream','Skull','Shield','Stand','Star','Storm','Streak','Sun','Thunder','Wind','Wrath');
|
||||
var colors = Array('Black','Blue','Brown','Gray','Green','Indego','Orange','Purple','Rainbow','Red','Scarlet','Violet','White','Yellow');
|
||||
var actors = Array('Condor','Eagle','Guardian','Hawk','Hydra','Lady','Lion','Scorpion','Spartan','Titan','Victor','Viking','Warrior');
|
||||
var mission_grammars = Array(
|
||||
{chance:30, grammar: 'adj1 + " " + noun1'},
|
||||
{chance:10, grammar: 'color + " " + noun1'},
|
||||
{chance:10, grammar: 'color + " " + actor'},
|
||||
{chance:10, grammar: 'actor +"\'s " + noun1'},
|
||||
{chance:10, grammar: 'noun1 + " of the " + noun2'},
|
||||
{chance:10, grammar: 'noun1 + " of " + noun2'},
|
||||
{chance:10, grammar: 'adj1 + " " + noun1 + " and " + adj2 + " " + noun2'},
|
||||
{chance:3, grammar: '"Attack of the " + actors + "s"'}
|
||||
);
|
||||
this.getNoun = function(badNouns) {
|
||||
return _.chain(nouns)
|
||||
.difference(badNouns)
|
||||
.sample()
|
||||
.value();
|
||||
};
|
||||
|
||||
this.getMissionName = function() {
|
||||
var adj1 = _.sample(adjectives);
|
||||
var adj2 = _.sample(adjectives);
|
||||
while(adj1 == adj2)
|
||||
adj2 = _.sample(adjectives);
|
||||
var badWords = _.uniq(adj1.split('|').slice(1).concat(adj2.split('|').slice(1)));
|
||||
var noun1 = self.getNoun(badWords);
|
||||
var noun2 = self.getNoun(badWords);
|
||||
while(noun1 == noun2)
|
||||
noun2 = self.getNoun(badWords);
|
||||
adj1 = adj1.split('|')[0];
|
||||
adj2 = adj2.split('|')[0];
|
||||
var color = _.sample(colors);
|
||||
var actor = _.sample(actors);
|
||||
|
||||
var mission = '';
|
||||
var rand = Math.floor(Math.random() * 100 + 1);
|
||||
if(rand <= 25)
|
||||
mission += 'Operation ';
|
||||
else if(rand <= 50)
|
||||
mission += 'Project ';
|
||||
else if(rand <= 75)
|
||||
mission += 'Code: ';
|
||||
|
||||
var sumChance = _.chain(mission_grammars).pluck('chance').reduce(function(sum, c) { return sum + c;}).value();
|
||||
rand = Math.floor(Math.random() * sumChance + 1);
|
||||
for(var gi in mission_grammars) {
|
||||
var g = mission_grammars[gi];
|
||||
if(rand > g.chance) {
|
||||
rand -= g.chance;
|
||||
}
|
||||
else {
|
||||
mission += eval(g.grammar);
|
||||
return mission;
|
||||
}
|
||||
}
|
||||
return '';
|
||||
};
|
||||
};
|
||||
|
||||
angular.module('MissionApp').controller('MissionController', [MissionController]);
|
||||
}(window.angular));
|
||||
@@ -0,0 +1,48 @@
|
||||
module Mission
|
||||
|
||||
@adjectives = []
|
||||
@nouns = []
|
||||
@colors = []
|
||||
@animals = []
|
||||
@mission_grammars = []
|
||||
|
||||
|
||||
def Mission.get_name()
|
||||
adj, bad_nouns = get_adj();
|
||||
noun = get_noun(bad_nouns)
|
||||
|
||||
adj2 = adj
|
||||
noun2 = noun
|
||||
while adj2[0] == adj[0] || noun2 == noun
|
||||
adj2, bad_nouns = get_adj();
|
||||
noun2 = get_noun(bad_nouns)
|
||||
end
|
||||
|
||||
color = get_color()
|
||||
animal = get_animal()
|
||||
|
||||
name = ""
|
||||
case rand(1..100)
|
||||
when 1..10
|
||||
name += "Project "
|
||||
when 11..20
|
||||
name += "Operation "
|
||||
end
|
||||
|
||||
total_prob = 0
|
||||
@mission_grammars.each{|grammar|
|
||||
grammar[0] = grammar[0].to_i
|
||||
total_prob += grammar[0]
|
||||
}
|
||||
chance = rand(1..total_prob)
|
||||
@mission_grammars.each{|grammar|
|
||||
if chance < grammar[0]
|
||||
name += eval(grammar[1])
|
||||
break
|
||||
end
|
||||
chance -= grammar[0]
|
||||
}
|
||||
|
||||
return name
|
||||
end
|
||||
end
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user