Programmers: up for a SDN weird code challenge?
Moderator: Thanas
May you be buried in flaming cow shit. I HATE Lisp with a passion. If I was stuck in elevator with a Lisp programmer and the guy that tossed shitty underwear on my head in high school, and I had a gun with one bullet, I'd shoot the Lisp programmer.Miles Teg wrote:How about Lisp, or perhaps Prolog?
On topic, like Beowulf I need some direction. I might think of something on my own, but I'm a bit too use to these things called requirements.
Artillery. Its what's for dinner.
Isn't that what indentation is for?Arrow wrote:Bah, you try counting parenthesis by hand for a semster! Cheap ass dev environment...phongn wrote:You are weak!
"preemptive killing of cops might not be such a bad idea from a personal saftey[sic] standpoint..." --Keevan Colton
"There's a word for bias you can't see: Yours." -- William Saletan
"There's a word for bias you can't see: Yours." -- William Saletan
Ok, my first semster our professor had us use Dr. Scheme, and that worked pretty well. Then a couple of semsters later, we had a new (and incomponent) professor that made us do the projects in class, without any kind of editor (that was beyond her understanding). That, in combination with other bad memories of gross stupidity from that class has turned me off to Lisp.phongn wrote:I used jEdit for writing code and then imported it into the Lisp interpreter. But I suppose we could use something like Haskall, ML or F# instead
If we had a shudder emoticon, I'd be using it right now.
Artillery. Its what's for dinner.
- Prozac the Robert
- Jedi Master
- Posts: 1327
- Joined: 2004-05-05 09:01am
- Location: UK
Since I have no apreciable skill with programing, I'll simply point at this little masterpiece of computer language creation by some more talented people: The Shakespeare Programming Language
Variables are characters, defined like so:
Variables are characters, defined like so:
Operations on variables are carried out as part of a conversation between two characters. GOTOs are implemented by jumping between scenes. Eg:Romeo, a young man of Verona.
Juliet, a young woman.
Hamlet, a temporary variable from Denmark.
The Ghost, a limiting factor (and by a remarkable coincidence also
Hamlet's father).
Take a look at some of the complete example programs, some of them are pretty funny.Juliet:
Art thou more cunning than the Ghost?
Romeo:
If so, let us proceed to scene V.
Hi! I'm Prozac the Robert!
EBC: "We can categorically state that we will be releasing giant man-eating badgers into the area."
EBC: "We can categorically state that we will be releasing giant man-eating badgers into the area."
Though jEdit is suitable, it lacks a lot of the integration that Emacs has with Lisp (emacs is written in Lisp). For instance, you can run just about any lisp interpreter directly in Emacs.phongn wrote:I used jEdit for writing code and then imported it into the Lisp interpreter. But I suppose we could use something like Haskall, ML or F# insteadArrow wrote:Bah, you try counting parenthesis by hand for a semster! Cheap ass dev environment...phongn wrote:You are weak!
Now I am become death -- the shatterer of worlds...
-- Oppenheimer 1945
-- Oppenheimer 1945
Arrow wrote:May you be buried in flaming cow shit. I HATE Lisp with a passion. If I was stuck in elevator with a Lisp programmer and the guy that tossed shitty underwear on my head in high school, and I had a gun with one bullet, I'd shoot the Lisp programmer.Miles Teg wrote:How about Lisp, or perhaps Prolog?
On topic, like Beowulf I need some direction. I might think of something on my own, but I'm a bit too use to these things called requirements.
hahahah.. I was about to say the similar things about the guy who suggested PHP... The only thing I can think of that is worse is Python....
Miles Teg
Now I am become death -- the shatterer of worlds...
-- Oppenheimer 1945
-- Oppenheimer 1945
Or a FORTRAN program written with job security in mind. Obtuse and excessive common block masking is next to impossible to figure out.Miles Teg wrote:hahahah.. I was about to say the similar things about the guy who suggested PHP... The only thing I can think of that is worse is Python....
Miles Teg
Artillery. Its what's for dinner.
- The Aliens
- Keeper of the Lore
- Posts: 1482
- Joined: 2003-12-29 07:28pm
- Location: hovering high up above, making home movies for the folks back home.
- Contact:
I didn't feel like learning a wholly new operating system for a few weeks of LispMiles Teg wrote:Though jEdit is suitable, it lacks a lot of the integration that Emacs has with Lisp (emacs is written in Lisp). For instance, you can run just about any lisp interpreter directly in Emacs.
Hey now, what's with the Python hate? I can agree with PHP - I currently do some development in ASP.NET/C#.Miles Teg wrote:hahahah.. I was about to say the similar things about the guy who suggested PHP... The only thing I can think of that is worse is Python....
- Dooey Jo
- Sith Devotee
- Posts: 3127
- Joined: 2002-08-09 01:09pm
- Location: The land beyond the forest; Sweden.
- Contact:
Well here's something... interesting I threw together.
It weirdifies sentences that you type into it, turning them into gibberish.
Code: Select all
#include <cstdlib>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <algorithm>
class CMystery {
std::string m_likeStr;
std::string m_vowels;
std::string m_consonants;
std::vector<std::string> m_mysteryWords;
public:
CMystery() {
m_likeStr = "abcdefghijklmnopqrstuvwxyz";
m_vowels = "aeiouy";
m_consonants = "bdfghjklmnpqrstvwxyz";
m_mysteryWords.push_back("ise");
m_mysteryWords.push_back("er");
m_mysteryWords.push_back("es");
m_mysteryWords.push_back("ing");
m_mysteryWords.push_back("able");
m_mysteryWords.push_back("ard");
m_mysteryWords.push_back("ate");
m_mysteryWords.push_back("ery");
m_mysteryWords.push_back("ian");
m_mysteryWords.push_back("oid");
m_mysteryWords.push_back("us");
m_mysteryWords.push_back("ily");
m_mysteryWords.push_back("ern");
m_mysteryWords.push_back("ish");
}
std::string Babblise(const std::string &str) {
if (str.size() == 0) return "I see what you did there.";
std::string lStr = str;
int (*pf)(int)=tolower;
std::transform(lStr.begin(),lStr.end(), lStr.begin(), pf);
std::vector<std::string> words;
std::istringstream is(lStr);
std::string tStr;
while ((is >> tStr) && (tStr != "")) {
std::string addStr;
for (int i=0; i<tStr.size(); ++i) {
if (m_likeStr.find(tStr[i]) != std::string::npos)
addStr += tStr[i];
}
if (addStr != "")
words.push_back(addStr);
}
std::string writeStr;
while (words.size() > 0) {
unsigned int i = rand()%words.size();
writeStr += words[i];
unsigned int testes = m_mysteryWords.size()<<1;
unsigned int index = rand() % testes;
if (index < m_mysteryWords.size()) {
if (m_vowels.find(words[i].at(words[i].size()-1)) != std::string::npos)
writeStr += m_consonants[rand()%m_consonants.size()];
writeStr += m_mysteryWords[index];
}
if (words.size() != 1) writeStr += " ";
else writeStr += ".";
std::vector<std::string>::iterator it = words.begin() + i;
words.erase(it);
}
if (writeStr.size() > 0)
writeStr[0] = toupper(writeStr[0]);
return writeStr;
}
};
using namespace std;
int main(int argc, char *argv[])
{
srand(time(0));
cout << "Dooey's can o' worms!!\n\nWrite something fancy!\n\n";
CMystery omfg;
string inStr;
while (getline(cin,inStr)) {
if (inStr == "exit" || inStr == "no" || inStr == "I don't wanna!")
break;
cout << endl << "You wrote " << "\"" << inStr << "\"\n"
<< "I write: " << omfg.Babblise(inStr) << "\n"
<< "Write something more!\n\n";
}
return 0;
}
"Nippon ichi, bitches! Boing-boing."
Mai smote the demonic fires of heck...
Faker Ninjas invented ninjitsu
Mai smote the demonic fires of heck...
Faker Ninjas invented ninjitsu
- Prozac the Robert
- Jedi Master
- Posts: 1327
- Joined: 2004-05-05 09:01am
- Location: UK
I can't really code but I try
A cookie if you recognise it, two if you know what it says. Yes, you can compile it.
Code: Select all
++++++++++
[>+++++++>++++++++++>+++>+>++++++++<<<<<-]
>++.
>+.
+++++++.
.
+++.
>++.
>>+++.
<<<<----.
>>>>-----.
<<.
+.
>.
- Dahak
- Emperor's Hand
- Posts: 7292
- Joined: 2002-10-29 12:08pm
- Location: Admiralty House, Landing, Manticore
- Contact:
...Brainfuck?Bounty wrote:I can't really code but I try
A cookie if you recognise it, two if you know what it says. Yes, you can compile it.Code: Select all
++++++++++ [>+++++++>++++++++++>+++>+>++++++++<<<<<-] >++. >+. +++++++. . +++. >++. >>+++. <<<<----. >>>>-----. <<. +. >.
Though I'd have to look into it to know what it means
Great Dolphin Conspiracy - Chatter box
"Implications: we have been intercepted deliberately by a means unknown, for a purpose unknown, and transferred to a place unknown by a form of intelligence unknown. Apart from the unknown, everything is obvious." ZORAC
GALE Force Euro Wimp
Human dignity shall be inviolable. To respect and protect it shall be the duty of all state authority.