Jump to content
BrainDen.com - Brain Teasers

unreality

Members
  • Posts

    6378
  • Joined

  • Last visited

Posts posted by unreality

  1. Don't take amphetamines on a regular basis, even if your doctor prescribes them. As has been said before, they are good (and even, very helpful) on occasion but they definitely make you into a different person. It all comes down to the definition of mental disorder. Is ADHD really a mental disorder that needs "fixing" even if fixing it makes you a completely different person? I guess if the person with it wants to change and be "less zany", it should be up to them, but keep in mind it could be things like zaniness that make you who you are. There's no need to conform to what society classifies as normal intelligence unless you truly believe your ability to concentrate and operate and live is severely affected without the medication...

  2. PM me, I'll unload some arguments & sources on you. There are a lot of substances I would legalize _before_ marijuana (i.e. LSD i think can be _very_ helpful to society), but nevertheless marijuana is still less of a societal danger than alcohol or cigarettes. In an idea world we would make them all illegal but people are too curious for that to be a feasible reality so we have to accept the actual reality and take steps in harm reduction (like Switzerland et al).

  3. Yes the "extra" piece of info here is that they have to be integers. This doesn't always guarantee a unique solution, in fact these types of problems are generally very difficult (see Diophantine equations or Fermat's last theorem) but in your case, that was the extra info needed to make up for the lack of a 3rd equation.

    The problem with curr3nt's assertion however is that he assumes they are positive integers when integer doesn't specify sign.

    (1) c + s + r = 100

    (2) 50c + 10s + .5r = 1,000

    Question: Find the solution of c, s, and r in integers.

    take the original equation set and multiply the first by 20 and the second by 2 to get:

    20c + 20s + 20r = 2000

    100c + 20s + r = 2000

    Once again, subtract the first from the second:

    80c - 19r = 0

    80c = 19r

    Here is where the integer thing helps. 19 is prime, thus 80 and 19 are coprime. It basically means that c has to be a multiple of 19 and r has to be a multiple of 80. This can be more easily seen by dividing them out:

    c = 19r / 80

    r clearly needs to be a multiple of 80 to make c an integer, since 19 never divides 80. Therefore r = 80k, where k is some integer (including zero and negative integers), and thus c = 19k

    Anyway, going back to the original equation:

    s+r+c=100

    s + 99k = 100

    So now we have all three as a function of a single parameter:

    r = 80k

    c = 19k

    s = 100 - 99k

    If they have to be positive, clearly the only solution is from the parameter k=1 (leading to 80,19,1) but it's important to note that ANY integer choice for k will satisfy this. You can check this yourself. It works for k=0, k=2, k = -1, etc. But only k=1 gives positive integer answers. So really it depends on what it's asking for

  4. Now it seems we're stuck between two evils: support a government with which we disagree or rebel against an institution that gives us safety and peace.

    this is a quote war so I'm gonna throw down mr franklin: "Those who would give up Essential Liberty to purchase a little Temporary Safety, deserve neither Liberty nor Safety."

  5. OK UTF Ill play devils advocate here

    If you don’t vote don’t b***H. I understand you like neither of the 2 options that have any hope of winning the election, but there are other people you can vote for or even spoil your ballot. If you vote for a 3rd party candidate or spoil your vote than you have said to the 2 main parties here is someone who takes the time to vote but doesn’t like us. they will and trust me they continually do ask themselves the question of how to get you to vote for them. The parties all consider voter participation as a factor. the lower the turnout they have to listen to the population and only have to gear themselves to their "Core" voters. This is the main reason that the republicans and the democrats as parties are drifting farther and farther to the right and left respectively. the Middle doesn’t vote so ya gotta get the extremes worked up so that they come and support your side.

    Unfortunately you are entirely incorrect Quag... the parties aren't drifting away from center, they're drifting toward center. Everyone thinks they know the difference between Democrats and Republicans but it has become so convoluted that I challenge you to go to their websites, look at their platforms (in detail, not their broad statements), then the legalese, and try to tell me how different they really are. If you constrict your mind to one of the two main parties, you really are choosing between the lesser of two evils. Though they are both quite evil so it's hard to say what's lesser :lol:

    Remember if you take the time to spoil your ballot you have said to BOTH main parties I am politically engaged but like neither of your parties. If enough people spoil their ballots the 2 parties will both try and figure out what these people who vote neither Dem nor Rep want and adopt their platforms to try and get you to support them. No political party is likely to ever be 100% in sync with your political beliefs but you hope they come close.

    Agreed. 3rd party is the way to go.

    So basicall i`m saying vote either for the lesser of 2 evils (as you view them, please I'm not advocating dem/rep), 3rd party or spoil your ballot.

    yep those are pretty much the options haha.

    I must say I dislike your use of the term violence here. The govt of does not shoot you with bullets if you dont pay taxes. They will fine you and if you continue to refuse to pay your taxes they can put you in jail but i do not consider incarceration as violence. that is an increadibly broad view of the term you are using and comparing incarceration for unpaid taxes to the horrors of war in afganistan and iraq is well.. unseemly to me.

    Sure one is not as bad as the other perhaps but they're both using force to dominate a less powerful. Argue the semantics all you want but the end result is the same, and that's control.

    Many people probably still consider voting patriotic--they say it's your duty as a U.S. citizen to vote, especially in major elections such as the 2012 presidential election. But, really? Is voting really a good thing? What if I don't support the government?

    Currently the government taxes us to pay for many things many of us don't support. If I don't support various wars in the Middle East, for example, should I be forced to pay for them anyways?

    In the U.S. we have this thing called free speech, in which we can express our disagreement with these wars without being kidnapped and held captive by the government. But, if we wish to follow through with our disagreement by not financially supporting these wars that we don't support, all of a sudden we will get kidnapped and locked in a cage by the government. Why? Why don't we have the right to disagree?

    Currently I don't have the right to not pay taxes for the Afghanistan War, but that's a right I think I should have.

    In 2012, whether Barack Obama gets reelected or the Republican nominee gains control of the big guns, neither will do any nothing to stop the government from violently forcing me and many other people from paying for these things that we do not wish to support.

    Should I still vote for the candidate that I think is less immoral? Or should I vote for some no-name (like myself) who stands no chance of getting elected? Or should I not vote at all?

    I think any vote gives legitimacy to the government. Any vote for any candidate is an expression that I support the system. I don't support the system, though. I don't want Barack Obama or any of the Republican candidates to be the President. I don't want anyone to be the President. I don't want anyone to be able to declare war and force me to pay for it against my will.

    So I shouldn't vote. I could vote for the lesser of two evils, but that would just perpetuate the government I despise. I think voting IS bad after all.

    What do you think? Is voting bad?

    Remember that when you vote you give legitimacy to the government that uses violence to force me to pay for other people to go across the world and commit more violence against other violent people. You might think that violence should be used against those other violent people to prevent them from committing their crimes against the innocent citizens of some of those foreign states. But, if that is the case, then remember that you can pay to go fight wars against those people yourself. You don't have to use violence against me as well to force me to pay for the wars against my will.

    Aaah, so much I can say here, both in agreement and in disagreement. But I will let the smartest man I've ever heard (almost said known, but I guess I didn't "know" him :( ) jump in on this one.

    "I don't vote. Two reasons. First of all it's meaningless; this country was bought and sold a long time ago. The sh#@ they shovel around every 4 years *pfff* doesn't mean a f&^%ing thing. Secondly, I believe if you vote, you have no right to complain. People like to twist that around ; they say, 'If you don't vote, you have no right to complain', but where's the logic in that? If you vote and you elect dishonest, incompetent people into office who screw everything up, you are responsible for what they have done. You caused the problem; you voted them in; you have no right to complain. I, on the other hand, who did not vote, who in fact did not even leave the house on election day, am in no way responsible for what these people have done and have every right to complain about the mess you created that I had nothing to do with."

    That was George Carlin

    I agree with both of the above. I do not support the government either. Let's face it, the government sucks. They've all but drowned themselves in their own red tape. The counterargument to that is "you can't do better, try running a country!" but that's a bunch of bullsh*t. Sure there's going to be red tape, there's going to be corruption, there will be problems. Money, taxes, are always problematic because people like money. But despite all that, I guaran-f*cking-tee you I can run a country better than what's going on right now :duh::mad::rolleyes: Any of us here could. Working together is where it gets hard of course, but if we tore it all down and started again it would be so much better, you can't deny that. But I digress. As Charles Beard said, ""It is sobering to reflect that one of the best ways to get yourself a reputation as a dangerous citizen these days is to go about repeating the very phrases which our founding fathers used in the struggle for independence."

    I agree with pretty much everything that Quag said. I have to disagree with George Carlin on this one. Inaction is as much a form of action as voting is.

    That's the whole point. By not voting you are making a statement. A statement more powerful than you could make by voting, perhaps. But I don't really believe in nonvoting either. I plan on voting for a third party because that's even more impact... aka, your vote is tallied, but in defiance of the dems/reps, and in favor of something you actually support. When anyone says they've voted for a Democrat or Republican I immediately lose respect for them (political respect at least), though when people say they don't vote I lose a lot of respect there too because I chalk it up to apathy. But when they don't vote as a legitimate statement, I can accept and respect that at least.

    To expound on my earlier post, the idea of equating money with speech has always seemed patently absurd to me. The idea behind "free speech" is that everyone has a voice and has a chance to present their opinion in the public sphere. We all have the same opportunity because we all have the same power behind our voice. If you treat money as speech, then suddenly we are not all equal in terms of "free speech." If I have $500,000 and you have $30,000, do I have more speech than you do? :huh: That doesn't make any sense.

    Of course it doesn't make sense but it's the unfortunate reality. Money talks and despite the rampant liberalism we still live in a capitalist society, so of course money has found its way into free speech. Whoever has more money, does indeed have more ability to reach more people with their message.

    I also agree with Quag's assertion that UtF's system of taxing would equate to anarchy. I don't support the wars either, but had Al Gore been sworn into office in 2001 instead of Bush, I'm confident that the number of wars in which we would have engaged in the last decade (and the amount of money poured into them) would have been greatly diminished. But Bush managed to squeak his way onto the podium and it is what it is. :( If I were allowed to stipulate that I didn't want the government to spend "my" money on X, Y or Z, then soon we would have government unable to do anything (and I mean anything). Everyone would be putting so much red tape on how their money could be used, it wouldn't be possible to use it anywhere (even where it ought to be used and needed to be used). The only sane method for controlling where your money gets used by the government is to help elect people who will use the money as you want it to be used. And helping to get that candidate elected by, I don't know, community organizing or something. ;):D

    That's so distant. Congressmen hardly do what you want them to, and a lot of times they don't even vote. It may be the best way but it still sucks.But the majority of the organized world we have to put up with is terrible in one way or another so what can you do :lol:

  6. First of all I don't believe in the IQ tests. If you already got a 144 you already know you're quite smart, why does the IQ even matter? Someone else made it up and we still can't figure out what intelligence really is or what it means, so don't stress too hard about it. There are also different types of intelligence. But you might want to look into doing mental math and "chain memory" exercises, as well as (as others have mentioned) logic problems on this site :P if you're really serious there are drugs called nootropics which supposedly improve memory but i don't know how valid or safe they are and I've never personally tried one. Ones that are more common and probably safe are the B vitamins. Ones that are more experimental but possibly valid are the -racetams, for example, piracetam. But don't take my word on it and it's probably bad in the long run. Then there's amphetamines which are DEFINITELY bad in the long run.

  7. Looks good to me too (not that I really play rollo anymore lol, its momentum kind of drives itself now). But I do like the variation in letter length since I feel like most interesting 5-letter words will probably start getting recycled fairly soon.

  8.     ?????
    
     1. NIGHT - 1
    
     2. RINGS - 2
    
     3. DINER - 2
    
     4. HINGE - 1
    
     5. YIKES - 3
    
    

    DINES:

    if 3 then last letter is S; (this is what I'm expecting)

    if 1 then last letter is R.

  9. nice - it's likely we got the majority of our dictionary source from the same place since the fivelet.txt also has about ~8640 words. I'm checking out the xls right now though, nice nice :) Is this the system you use practically?

  10. The 5-letter-word dictionary I uploaded isn't as hefty as it probably could be though... if anyone has a better one, the format is for the file to just have all the words together, separated by spaces (it doesn't matter whether the words are lower or upper case) and nothing else. If your format is significantly different, let me know and I can easily extend the code to read in different types of formats. (I.e. if your dictionary has commas or newlines between every word that's an easy fix -- either a mass Find+Replace on your end or a code adjustment on mine).

    And actually if the words in your dictionary are separated by newlines, tabs, spaces, or any other arbitrary series of combinations of whitespace, it will already work with my code

  11. I was going to upload the file but the board won't let me here (same with the actual executable), so I'll post the code in here. I did however upload fivelet.txt which is a pretty decently sized dictionary file for 5 letter words in the desired format my program wants. fivelet.txt (You're going to want to put that in the same directory as rollo_champ.cpp).

    Here's the code:

    :("ABCDEFGHIJKLMNOPQRSTUVWXYZ")); if (permissible.find_first_of(toupper(c)) == string::npos) return false; else return true; } void makeUpper(string & g) { for (int j=0; j<g.size(); j++) g[j] = toupper(g[j]); } bool matchTest(string & g, vector < pair< string, int > > * f) { for (int q=0; q<f->size(); q++) { if (scoreWord(f->at(q).first, g) != f->at(q).second) { return false; } } return true; } int scoreWord(string & testWord, string & theWord) { if (testWord.size() != theWord.size()) return -1; int score = 0; for (int x=0; x<testWord.size(); x++) { if (testWord.at(x) == theWord.at(x)) score++; } return score; } bool matchGivenLetters(string & g, string & csa) { for (int y=0; y<g.size(); y++) { if (csa.at(y) != '?' && csa.at(y) != g.at(y)) return false; } return true; }
    
    /* ROLLO CHAMP (rollo_champ.cpp)
    
       by Unreality (N.R.)
    
       Mon Mar 7, 2011 through Sun Mar 13, 2011
    
    */
    
    
    using namespace std;
    
    #include <iostream>
    
    #include <fstream>
    
    #include <string>
    
    #include <vector>
    
    
    
    bool guessTest(string &, int, bool);
    
    bool guessCharTest(char,bool);
    
    void makeUpper(string &);
    
    bool matchTest(string &, vector < pair< string, int > > *);
    
    int scoreWord(string &,string &);
    
    bool matchGivenLetters(string &, string &);
    
    
    int main()
    
    {
    
    	// Phase I: retrieve dictionary
    
    	///////////////////////////////
    
    	cout << endl;
    
    	fstream inf;
    
    	bool prompt = true;
    
    	string fname;
    
    	while (prompt)
    
        {
    
    		cout << "Enter filename of your space-delimited ROLLO dictionary file (enter a dot to use fivelet.txt)\n\t";
    
    		cin >> fname; if (fname==".") fname="fivelet.txt";
    
    		// attempt to open file
    
    		inf.open(fname.c_str());
    
    		// valid?
    
    		prompt = inf.fail();
    
    		if (prompt) cout << "\nThat file does not exist!\n";
    
        }
    
    
    	// Phase II: retrieve gamestate
    
    	///////////////////////////////
    
    	int numL=5; string numLS;
    
    	cout << "Number of Letters per ROLLO word (default 5): ";
    
    	cin >> numLS;
    
    	numL = atoi(numLS.c_str());
    
    	if (numL < 1) numL = 5;
    
    	cout << "Enter the " << numL << "-lettered word as it is known, using question marks for unknown letters:\n";
    
    	cout << endl;
    
    	prompt = true;
    
    	string cs;
    
    	while (prompt)
    
    	{
    
    		cout << "   "; for (int iz=0; iz<numL; iz++) cout << "_"; cout << "\n>: ";
    
    		cin >> cs;
    
    		makeUpper(cs);
    
    		prompt = !guessTest(cs, numL, true);
    
    		if (prompt) cout << "\nMust be a valid (A-Z or '?') " << numL << "-lettered word... try again.\n";
    
    	}
    
    
    	cout << "\n\nNow enter the words guessed so far and their scores.";
    
    	cout << "\n\nEnter a " << numL << " for the score to cancel adding the guess (if you make a mistake).";
    
    	cout << "\n\nEnter just a tilde to analyze current guesses. Enter a hyphen to analyze and then quit.";
    
    	cout << "\n\nTo edit a prior guess, enter a $ followed by the word, then a colon, then the new guess value. Enter " << numL << " for the guess value to delete that entry.\n\n";
    
    	string guess=""; int guessval=0;
    
    	vector < pair< string, int > > guesses;
    
    	vector<string> fit;
    
    	bool dontQuit = true, firstTime = true, getGuesses, addWord, commencePhaseThree, reopenFile;
    
    	while(dontQuit)
    
    	{
    
    		getGuesses = true;
    
    		commencePhaseThree = true;
    
    		reopenFile = false;
    
    		int guessesAdded = 0;
    
    		// collect guesses / more guesses
    
    		while (getGuesses)
    
    		{
    
    			prompt = true; 
    
    			while (prompt)
    
    			{
    
    				// get the guess
    
    				cout << "Guess:\t";
    
    				cin >> guess;
    
    
    				// process the guess
    
    				if (guess == "-")      { prompt = false; getGuesses = false;  dontQuit = false; }
    
    				else if (guess == "~") { prompt = false; getGuesses = false;                    }
    
    				else if (guess.at(0) == '$')
    
    				{
    
    					if (guess.size() < 3+numL)
    
    					{
    
    						cout << "An edit string should be of the form $word:newscore";
    
    						if (guesses.size() > 0) cout << ", e.g. $" << guesses.at(0).first << ":" << ( (guesses.at(0).second == 1) ? "2" : "1" );
    
    						else cout << ".";
    
    						cout << "\nOr have newscore be " << numL << " to delete the guess.\n";
    
    						prompt = false; getGuesses = false; commencePhaseThree = false;
    
    					}
    
    					else
    
    					{
    
    						makeUpper(guess);
    
    						int newGuessVal = atoi(guess.substr(numL+2).c_str());
    
    						if (newGuessVal == numL)
    
    						{
    
    							// delete the guess
    
    							vector < pair< string, int > > newguesses;
    
    							bool foundGuess = false;
    
    							for (int myit = 0; myit < guesses.size(); myit++)
    
    							{
    
    								if (guesses.at(myit).first != guess.substr(1,numL))
    
    								{
    
    									newguesses.push_back(guesses.at(myit));
    
    								}
    
    								else
    
    								{
    
    									foundGuess = true;
    
    								}
    
    							}
    
    							guesses = newguesses;
    
    							if (foundGuess)
    
    								{ cout << "(Deleted " << guess.substr(1,numL) << ")\n"; reopenFile = true; }
    
    							else
    
    								{ cout << "Guess Not Found\n"; commencePhaseThree = false; }
    
    						}
    
    						else if (newGuessVal >= 0 && newGuessVal < numL)
    
    						{
    
    							// edit the guess
    
    							bool foundGuess=false;
    
    							for (int myit = 0; myit < guesses.size(); myit++)
    
    								{ if (guesses.at(myit).first == guess.substr(1,numL))
    
    									{ foundGuess=true; guesses.at(myit).second = newGuessVal; } }
    
    							if (foundGuess)
    
    								{ cout << "(Score of " << guess.substr(1,numL) << " changed to " << newGuessVal << ")\n"; reopenFile = true; }
    
    							else
    
    								{ cout << "Guess Not Found\n"; commencePhaseThree = false; }
    
    						}
    
    						else { cout << "That's out of the range of possible scores. No change occurred.\n"; commencePhaseThree = false; }
    
    						prompt = false; getGuesses = false;
    
    					}
    
    				}
    
    				else
    
    				{
    
    					prompt = !guessTest(guess, numL, false);
    
    					if (prompt) cout << "Invalid Guess, try again.\n";
    
    				}
    
    			}
    
    			if (getGuesses)
    
    			{
    
    				// guess is valid : attach a score to it
    
    				makeUpper(guess);
    
    				prompt = true;
    
    				while (prompt)
    
    				{
    
    					cout << "Score of Guess (" << guess << "):\t";
    
    					cin >> numLS;
    
    					// Because of the annoying nature of atoi (returning 0 for non-numerics),
    
    					// there's no way to distinguish an invalid string from one in which you wanted to say was zero.
    
    					// That means the way to actually say a guess scored 0 letters is to type just exactly 0 for the input.
    
    					if (numLS=="0") { guessval = 0; prompt = false; addWord = true; }
    
    					else
    
    					{
    
    						// zero isn't the score so now atoi can be checked for equality with zero
    
    						// in order to catch non-numeric inputs...
    
    						guessval = atoi(numLS.c_str());
    
    						if (guessval <= 0 || guessval > numL) { cout << "That's not a feasible score, try again. Enter " << numL << " for the score to cancel adding this word.\n"; }
    
    						else if (guessval == numL) { cout << "Word not added.\n"; prompt = false; addWord = false; }
    
    						else { prompt = false; addWord = true; }
    
    					}
    
    				}
    
    				// anything that sets prompt false in the above While loop must also decide on a value for addWord
    
    				if (addWord) { guesses.push_back(make_pair(guess, guessval)); guessesAdded++; }
    
    				cout << endl;
    
    			}
    
    		}
    
    
    
    		// Phase III: reduce possibilities with logic and linguistics (based on dictionary file)
    
    		// begin by reducing the dictionary to include only words that fit the already known letters
    
    		// and would score correctly given the guesses so far.
    
    		// If the dictionary has already been scanned, then just look at the guesses added and make
    
    		// sure the words match up to them, removing words that don't satisfy the new guesses' requirements.
    
    		// (Unless a previous guess has been edited or deleted; this changes everything and needs a re-read from the dictionary file).
    
    		//
    
    		// I have proved that this method extracts the maximum information from the known situation, as far as you can logic (it would be pure logic
    
    		// if the dictionary file contained all 26^(numL) "words", but linguistic logic is factored in too because the dictionary
    
    		// is already its own filter from the getgo, deciding which words are acceptable.
    
    
    		if (commencePhaseThree)
    
    		{
    
    			cout << "\nSummary of Guesses\n";
    
    			int constCompare = guesses.size() - guessesAdded;
    
    			for (int i=0; i<guesses.size(); i++)
    
    			{
    
    				cout << guesses.at(i).first << " (" << guesses.at(i).second << ")" << ( (i >= constCompare) ? (" *\n") : ("\n") );
    
    			}
    
    			if (guessesAdded > 0) cout << "*";
    
    			cout << "(Added " << guessesAdded << " guess" << ( (guessesAdded == 1) ? ("") : ("es") ) << ")\n";
    
    
    			string wd;
    
    			vector < pair< string, int > > * ff = &guesses;
    
    			if (firstTime) // used the very first time the eligible words are calculated (future times just remove words that no longer match all guesses)
    
    			{
    
    				while (!inf.eof())
    
    				{
    
    					inf >> wd;
    
    					makeUpper(wd);
    
    					if (guessTest(wd, numL, false) && matchGivenLetters(wd,/*scored*/cs) && matchTest(wd, ff))  fit.push_back(wd);
    
    				}
    
    				inf.close();
    
    				firstTime=false;
    
    			}
    
    			else if (reopenFile) // used after an edit or deletion of an already made guess (because that changes everything so the file needs re-reading)
    
    			{
    
    				fit.clear();
    
    				inf.open(fname.c_str());
    
    				while (!inf.eof())
    
    				{
    
    					inf >> wd;
    
    					makeUpper(wd);
    
    					if (guessTest(wd, numL, false) && matchGivenLetters(wd,cs) && matchTest(wd, ff))  fit.push_back(wd);
    
    				}
    
    				inf.close();
    
    			}
    
    			else // remove words that no longer match with all the guesses
    
    			{
    
    				int remcount = 0;
    
    				bool * keepWords = new bool[fit.size()];
    
    				for (int ndex=0; ndex<fit.size(); ndex++)
    
    				{
    
    					if (!matchTest(fit.at(ndex), ff))
    
    					{
    
    						cout << "Removed " << fit.at(ndex) << endl;
    
    						remcount++;
    
    						keepWords[ndex] = false;
    
    					}
    
    					else keepWords[ndex] = true;
    
    				}
    
    				// remove them (can't remove them in the above loop because that would change fit's size and indices while fit is being looped over, a big no no)
    
    				vector<string> newfit;
    
    				for (int ndex=0; ndex<fit.size(); ndex++) if (keepWords[ndex]) newfit.push_back(fit.at(ndex));
    
    				fit = newfit;
    
    				// announce the removal
    
    				if (remcount > 0) cout << "(Removed " << remcount << " word" << ( (remcount==1) ? ("") : ("s") ) << ")" << endl;
    
    			}
    
    
    			cout << "\nPossibilities\n";
    
    			for (int i=0; i<fit.size(); i++) cout << fit[i] << endl;
    
    			if (fit.size() == 0) cout << "NONE" << endl;
    
    			else cout << "Count: " << fit.size() << endl << endl;
    
    		}
    
    		//////////////////////////
    
    
    
    	} // the only way to get out of here is for dontQuit to be false, which is only if they guessed a hyphen
    
    
    	// program finished
    
    	cout << "\nThanks for using Rollo Champ.\tby N. R. [Unreality] 2011\n";
    
    	return 0;
    
    }
    
    
    bool guessTest(string & g, int n, bool questionMarkAllowed)
    
    {
    
    	if (g.size() != n) return false;
    
    	for (int j=0; j<n; j++)
    
        {
    
    		if (!guessCharTest(g.at(j), questionMarkAllowed)) return false;
    
        }
    
    	return true;
    
    }
    
    
    bool guessCharTest(char c, bool questionMarkAllowed)
    
    {
    
    	string permissible = ((questionMarkAllowed)?("ABCDEFGHIJKLMNOPQRSTUVWXYZ?")
    Compile this with your favorite c++ compiler (works fine with make and g++ and I'm sure most other if not all compilers, assuming you have the standard libraries and such). If you have make (esp on the OSX) you can just do this:
    make rollo_champ
    or with g++ (which is more common, make just calls that anyway)
    g++ rollo_champ.cpp -o rollo_champ

    Then run the executable (./rollo_champ)

    I've been working at it to make sure it's entirely people-friendly. There's only so many things I could've anticipated though, so if you download it help me out and try to break it with faulty inputs :lol:

    I know something like this has the potential to take the fun out of ROLLO but I thought it was interesting to make anyway so why not share it I guess. Basically you just give it the dictionary file and then enter the guesses and their scores as given by the host (you can edit & remove guesses too, and continually update it, etc) to narrow down the dictionary. Maybe the tool could be helpful in other games or situations, idk. (at the least it's portable to rollo games played with not 5 letters). Anyway enjoy :)

  12. What about octal? It's more that much more divisible than base 10 (10 divides 1,2,5,10 ... 8 divides 1,2,4,8) but as a power of 2 it has certain advantages to use as a base system.

    The reason I say that instead of a more factorable system like duodecimal (12 divides 1,2,3,4,6,12) or sexagesimal like the Babylonians used (60 divides 1,2,3,4,5,6,10,12,15,20,30,60) is because the octal system would be easy to learn for kids. If you just stick your hands out in front of you and tuck your thumbs under your palms, there ya go, you have digits 0-7.

    But it's not that worth it since octal doesn't really provide that many more advantages over decimal (it's actually less efficient in terms of how many digits, requiring something like log(10)/log(8) times as many digits), other than breeding a future generation of good programmers because of how easy it'd be to convert to binary or hexadecimal :lol:

    I'm a fan of going back to sexagesimal if everyone can remember a bunch of symbols. I think binary is the most 'pure' but sexagesimal is on the opposite end of the spectrum. Think about doing fractions in sexagesimal, it'd be very easy, much easier than base 10.

    "one third" in decimal = 0.3333333333333333333333333333333...etc

    "one third" in sexagesimal = 0.[20] where [20] is a single digit representing our decimal "20"

    lots of other fractions could be expressed conveniently without so many repeating digits:

    fraction :: sexagesimal version

    1/2 :: 0.[30]

    1/3 :: 0.[20]

    1/4 :: 0.[15]

    1/5 :: 0.[12]

    1/6 :: 0.[10]

    1/7 :: 0.[8][34][17]...(repeats those 3 digits forever) ... this one is gonna be messy no matter what base system is used pretty much

    1/8 :: 0.[7][30] (think [7.5] being half of [15] which is 1/4)

    1/9 :: 0.[6][40] (think [6 + 2/3] being a third of [20] which is 1/3)

    1/10 :: 0.[6]

    etc. I'd rather teach a kid sexagesimal fractions than decimal versions. Then again the major drawback is having so many symbols. So I'm gonna have to go with binary... its purity is appealing, despite being the most inefficient (digits per number) of the systems

×
×
  • Create New...