Important notice about the future of Stripcreator (Updated: May 2nd, 2023)

stripcreator forums
Jump to:

Stripcreator » Regarding Stripcreator » How many votes is that?

Author

Message

evil_d
Riding through your town with his head on fire

Member Rated:

If you're like me, I'm sorry.  But if you're like me, you sometimes find yourself looking at a comic's rating and wondering what kind of votes it took to get that particular number, what its rating would be if the next person voted a certain way, etc.  I'm bad at math, so I wrote some JavaScript to help me play around with the numbers.

Instructions:

1. Save this code as an HTML file.
2. Open it in a web browser.
3. Figure it out your damn self.
4. Skip those steps and use Injokester's hosted copy.

 

<html>
<head>
<title>How Many Votes Is That?</title>
<style type="text/css">
  body { line-height: 1.7em; }
</style>
<script type="text/javascript">
function recalculate()  {

  numgood = (parseInt(document.f.g.value) ? parseInt(document.f.g.value) : 0);
  numokay = (parseInt(document.f.o.value) ? parseInt(document.f.o.value) : 0);
  numbad  = (parseInt(document.f.b.value) ? parseInt(document.f.b.value) : 0);
  numvotes = numgood + numokay + numbad;
  document.f.r.value = Math.round((((numgood * 10) + (numokay * 5)) / numvotes) * 100) / 100;
  document.f.v.value = numvotes;

}
</script>
</head>
<body>
<form name="f">

Good: <input type="text" name="g" value="0" size="3" onChange="recalculate();">
<input type="button" value="+" 
       onClick="document.f.g.value = (parseInt(document.f.g.value) ? parseInt(document.f.g.value) + 1 : 1); recalculate();">
<input type="button" value="&minus;" 
       onClick="document.f.g.value = (parseInt(document.f.g.value) ? parseInt(document.f.g.value) - 1 : 0); recalculate();">
<br>

Okay: <input type="text" name="o" size="3" value="0" onChange="recalculate();">
<input type="button" value="+" 
       onClick="document.f.o.value = (parseInt(document.f.o.value) ? parseInt(document.f.o.value) + 1 : 1); recalculate();">
<input type="button" value="&minus;" 
       onClick="document.f.o.value = (parseInt(document.f.o.value) ? parseInt(document.f.o.value) - 1 : 0); recalculate();">
<br>

&ensp;Bad: <input type="text" name="b" size="3" value="0" onChange="recalculate();">
<input type="button" value="+" 
       onClick="document.f.b.value = (parseInt(document.f.b.value) ? parseInt(document.f.b.value) + 1 : 1); recalculate();">
<input type="button" value="&minus;" 
       onClick="document.f.b.value = (parseInt(document.f.b.value) ? parseInt(document.f.b.value) - 1 : 0); recalculate();">
<br>

<br>
Rating: <input type="text" name="r" size="3">&ensp;
Votes: <input type="text" name="v" size="3">

</form>
</body>
</html>

[edited by evil_d on 03-28-09 at 10:03:11pm]

---
The what mentioned above is total fiction. Please don't take it seriously!

3-26-09 9:24am (new)
quote : comics : pm : info


Aylear
Still Alive

Member Rated:

Okay, my love for you right now is like a river of puppies and unicorn hair. You're bad at math, so you wrote some JavaScript. Holy shit.

Welp, thanks for being just like me. I sympathise.

3-26-09 1:55pm (new)
quote : comics : pm : info


evil_d
Riding through your town with his head on fire

Member Rated:

I appreciate your love as well as your colorful simile for it.

---
The what mentioned above is total fiction. Please don't take it seriously!

3-26-09 4:14pm (new)
quote : comics : pm : info


Injokester
Definitely drunk

Member Rated:

Nice!

I took the liberty of hosting it here for the technically challenged.

---
Dinosaurs had eggs bro, the chicken came way later.

3-26-09 7:09pm (new)
quote : comics : pm : info


evil_d
Riding through your town with his head on fire

Member Rated:

Good thinking; thanks.

---
The what mentioned above is total fiction. Please don't take it seriously!

3-26-09 9:00pm (new)
quote : comics : pm : info


Injokester
Definitely drunk

Member Rated:

Of course, I doubt the technically challenged will read past the first post, but that's their loss :)

---
Dinosaurs had eggs bro, the chicken came way later.

3-26-09 9:38pm (new)
quote : comics : pm : info


Tterb
doesn't even try anymore.

Member Rated:

This is real hopefully thanks Evil and Injokester. This is some good stuff.

---
horray for life. boo.

3-26-09 10:04pm (new)
quote : comics : pm : info


Brad
Feature Creep

Member Rated:

Fascinating -- now you should try to improve on my crappy algorithm!

---
www.bradsucks.net

3-28-09 11:02am (new)
quote : comics : pm : info


evil_d
Riding through your town with his head on fire

Member Rated:

Brad

if (username == "evil_d")  {
  score = 10;
else {
  score = 0;

---
The what mentioned above is total fiction. Please don't take it seriously!

3-28-09 10:13pm (new)
quote : comics : pm : info


TheGovernor
Talentless Hack

Member Rated:

This is by no means perfect and occasionally spits out some wacky numbers, but appears for the most part to work. Using evil_ds work as a base, and having a lazy sunday afternoon in which to tinker Ive made a simple calculator that attempts to backwards engineer possible voting combos based on a comics rating and votes.

 



How Many Votes Is That?

  body { line-height: 1.7em; }


function recalculate()  {

  numgood = (parseInt(document.f.g.value) ? parseInt(document.f.g.value) : 0);
  numokay = (parseInt(document.f.o.value) ? parseInt(document.f.o.value) : 0);
  numbad  = (parseInt(document.f.b.value) ? parseInt(document.f.b.value) : 0);
  numvotes = numgood + numokay + numbad;
  document.f.r.value = Math.round((((numgood * 10) + (numokay * 5)) / numvotes) * 100) / 100;
  document.f.v.value = numvotes;

}


function uncalculate() {

rating = document.shakedown.rat.value
votes = document.shakedown.votes.value

if (rating=="0" || votes=="0")
document.shakedown.combos.value = "Either they're all bad or you ain't grasped the concept of entering numbers in the boxes yet";
else
{
//origgoods = rating *votes /5-votes;
goods = Math.round((rating * votes)/5-votes);
//document.shakedown.combos.value = goods;

output = "Potential Voting combinations that could lead to these values \n\nGood Okay Bad\n"

oks = votes - goods;
bads= 0;
//output += Math.round((((goods * 10) + (oks * 5)) / votes) * 100) / 100 + "\n";  //test line
if (Math.round((((goods * 10) + (oks * 5)) / votes) * 100) / 100 != rating)
output += "I don't think its possible but here are ratings that would be in the ballpark \n";

do {

newline = goods + "  -  " + oks + "  -  " + bads + "\n";
output += newline;

oks = oks -2
goods += 1
bads +=1
} while (oks > -1)


document.shakedown.combos.value = output;
}
}




Good:

       onClick="document.f.g.value = (parseInt(document.f.g.value) ? parseInt(document.f.g.value) + 1 : 1); recalculate();">

       onClick="document.f.g.value = (parseInt(document.f.g.value) ? parseInt(document.f.g.value) - 1 : 0); recalculate();">



Okay:

       onClick="document.f.o.value = (parseInt(document.f.o.value) ? parseInt(document.f.o.value) + 1 : 1); recalculate();">

       onClick="document.f.o.value = (parseInt(document.f.o.value) ? parseInt(document.f.o.value) - 1 : 0); recalculate();">



 Bad:

       onClick="document.f.b.value = (parseInt(document.f.b.value) ? parseInt(document.f.b.value) + 1 : 1); recalculate();">

       onClick="document.f.b.value = (parseInt(document.f.b.value) ? parseInt(document.f.b.value) - 1 : 0); recalculate();">





Rating:  
Votes:


---------------


Enter your rating and number of votes below



Rating:  
Votes:

       onClick="uncalculate();">



Possible combinations of voting that would lead to that rating

<br />Enter votes and rating above<br />



 

3-29-09 9:05am (new)
quote : comics : pm : info


TheGovernor
Talentless Hack

Member Rated:

sorry looks like the preview button screwed it up in mozilla.

 

included a link, feel free to copy it over to comicsauce if you like injokester

 

 valcalc

3-29-09 9:11am (new)
quote : comics : pm : info


evil_d
Riding through your town with his head on fire

Member Rated:

Nicely done, Gov.

At the moment, our highest rated comic, pita's "Adam and Eve", is either 18-3-0 or 19-1-1.  My money's on the former.

---
The what mentioned above is total fiction. Please don't take it seriously!

3-29-09 9:25pm (new)
quote : comics : pm : info


Zaster
Wait for it...

Member Rated:

Comics have ratings?

---
I was gonna send a robot back in time, but I got high.

3-30-09 6:41am (new)
quote : comics : pm : info


AngryAmerican
Here at least 3 times a year

Member Rated:

I thought th apex of mathematics was long division.

In general I approve of math until it gets all uppity and starts using letters and whatnot. Then it needs to be lynched.

---
Kill Whitey.

4-03-09 9:33am (new)
quote : comics : pm : info

Stripcreator » Regarding Stripcreator » How many votes is that?


reload page with comics

Jump to:

Post A Reply


stripcreator
Make a comic
Your comics
Log in
Create account
Forums
Help
comics
Random Comic
Comic Contests
Sets
All Comics
Search
featuring
diesel sweeties
jerkcity
exploding dog
goats
ko fight club
penny arcade
chopping block
also
Brad Sucks