aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjaseg <jaseg@jaseg.net>2014-07-25 19:50:20 +0200
committerjaseg <jaseg@jaseg.net>2014-07-25 19:50:20 +0200
commit49cd6259ba0b556deb167b3fb76a61c3b344a786 (patch)
tree775b108de2c045f8ae8aeae10245551453df8a02
parent9744335ad536cf38e9dfd0a8f1a8c066a08ed943 (diff)
downloadmatelight-49cd6259ba0b556deb167b3fb76a61c3b344a786.tar.gz
matelight-49cd6259ba0b556deb167b3fb76a61c3b344a786.tar.bz2
matelight-49cd6259ba0b556deb167b3fb76a61c3b344a786.zip
Europython stuff
-rw-r--r--firmware/main.c16
-rw-r--r--host/default.lines343
-rwxr-xr-xhost/server.py22
3 files changed, 109 insertions, 272 deletions
diff --git a/firmware/main.c b/firmware/main.c
index d859454..55abeae 100644
--- a/firmware/main.c
+++ b/firmware/main.c
@@ -40,17 +40,17 @@
#define CRATE_SIZE (CRATE_WIDTH*CRATE_HEIGHT)
#define BUS_SIZE (CRATES_PER_BUS*CRATE_SIZE*BYTES_PER_PIXEL)
unsigned const char const BOTTLE_MAP[CRATE_SIZE] = {
- 17, 16, 15, 14, 13,
- 18, 9, 10, 11, 12,
- 19, 8, 7, 6, 5,
- 0, 1, 2, 3, 4
+ 4, 3, 2, 1, 0,
+ 5, 6, 7, 8,19,
+ 12, 11, 10, 9,18,
+ 13, 14, 15,16,17
};
unsigned const char const FUCKED_UP_BOTTLE_MAP[CRATE_SIZE] = {
- 3, 4, 5, 6, 7,
- 2, 11, 10, 9, 8,
- 1, 12, 13, 14, 15,
- 0, 19, 18, 17, 16
+ 16,17, 18,19, 0,
+ 15,14, 13,12, 1,
+ 8, 9, 10,11, 2,
+ 7, 6, 5, 4, 3
};
unsigned const char const CRATE_MAP[CRATE_COUNT] = {
diff --git a/host/default.lines b/host/default.lines
index ecf0862..050d78c 100644
--- a/host/default.lines
+++ b/host/default.lines
@@ -1,259 +1,88 @@
-\x1B[38;5;214mabstraction is a type of decadence
-\x1B[38;5;214mit's important to stay clean on all levels
-\x1B[38;5;214mexpiring for love is beautiful but stupid
-\x1B[38;5;214mlack of charisma can be fatal
-\x1B[38;5;214mambition is just as dangerous as complacency
-\x1B[38;5;214mslipping into madness is good for the sake of comparison
-\x1B[38;5;214mplanning for the future is escapism
-\x1B[38;5;214mtrue freedom is frightful
-\x1B[92mMate Light\x1B[0m powered by \x1B[95mData Becker™ \x1B[96mLaufschriftstudio 2000® Platinum Edition
-\x1B[38;5;214mreligion causes as many problems as it solves
-\x1B[38;5;214mdisorganization is a kind of anesthesia
-\x1B[38;5;214mpursuing pleasure for the sake of pleasure will ruin you
-\x1B[38;5;214manger or hate can be a useful motivating force
-\x1B[38;5;214mjust believing something can make it happen
-\x1B[38;5;214mtrading a life for a life is fair enough
-\x1B[38;5;214mlisten when your body talks
-\x1B[38;5;214mfake or real indifference is a powerful personal weapon
-\x1B[38;5;214mcalm is more conductive to creativity than is anxiety
-\x1B[38;5;214mthere are too few immutable truths today
-\x1B[38;5;214mbeing happy is more important than anything else
-\x1B[38;5;214mit can be helpful to keep going no matter what
-\x1B[38;5;214mbelieving in rebirth is the same as admitting defeat
-\x1B[38;5;214mit's vital to live in harmony with nature
-\x1B[38;5;214mdisgust is the appropriate response to most situations
-\x1B[38;5;214mnothing upsets the balance of good and evil
-\x1B[38;5;214mrandom mating is good for debunking sex myths
-\x1B[38;5;214manimalism is perfectly healthy
-\x1B[92mMate Light\x1B[0m powered by \x1B[95mSiemens™ \x1B[96mLaufschrift® v.0.1.2b fuer Intel™ Pentium®
-\x1B[38;5;214msalvation can't be bought and sold
-\x1B[38;5;214mextreme self-consciousness leads to perversion
-\x1B[38;5;214mroutine small excesses are worse than then the occasional debauch
-\x1B[38;5;214mwe must make sacrifices to maintain our quality of life
-\x1B[38;5;214mmuch was decided before you were born
-\x1B[38;5;214ma positive attitude means all the difference in the world
-\x1B[38;5;214myou must have one grand passion
-\x1B[38;5;214mit is heroic to try to stop time
-\x1B[38;5;214moccasionally principles are more valuable than people
-\x1B[38;5;214ma sense of timing is the mark of genius
-\x1B[38;5;214mexpressing anger is necessary
-\x1B[38;5;214mroutine is a link with the past
-\x1B[38;5;214mtorture is barbaric
-\x1B[38;5;214melaboration is a form of pollution
-\x1B[38;5;214mpeople are responsible for what they do unless they are insane
-\x1B[38;5;214mromantic love was invented to manipulate women
-\x1B[38;5;214msex differences are here to stay
-\x1B[38;5;214mthe unattainable is invariable attractive
-\x1B[38;5;214ma man can't know what it is to be a mother
-\x1B[38;5;214mthere's nothing except what you sense
-\x1B[38;5;214msurvival of the fittest applies to men and animals
-\x1B[38;5;214man elite is inevitable
-\x1B[38;5;214mit is man's fate to outsmart himself
-\x1B[38;5;214mpeople won't behave if they have nothing to lose
-\x1B[38;5;214mpeople are nuts if they think they are important
-\x1B[38;5;214many surplus is immoral
-\x1B[38;5;214mremember you always have freedom of choice
-\x1B[38;5;214ma lot of professionals are crackpots
-\x1B[38;5;214msacrificing yourself for a bad cause is not a moral act
-\x1B[38;5;214mit's better to be naive than jaded
-\x1B[38;5;214mdependence can be a meal ticket
-\x1B[38;5;214mkeep something in reserve for emergencies
-\x1B[38;5;214mold friends are better left in the past
-\x1B[38;5;214mmoney creates taste
-\x1B[38;5;214mto disagree presupposes moral integrity
-\x1B[38;5;214mbeing sure of yourself means you're a fool
-\x1B[38;5;214myou must know where you stop and the world begins
-\x1B[38;5;214mideals are replaced by conventional goals at a certain age
-\x1B[38;5;214mmost people are not fit to rule themselves
-\x1B[38;5;214mguilt and self-laceration are indulgences
-\x1B[38;5;214mit's better to be lonely than to be with inferior people
-\x1B[38;5;214mdying and coming back gives you considerable perspective
-\x1B[38;5;214mabsolute submission can be a form of freedom
-\x1B[38;5;214mfear is the greatest incapacitator
-\x1B[38;5;214mholding back protects your vital energies
-\x1B[38;5;214mwhen something terrible happens people wake up
-\x1B[38;5;214mensure that your life stays in flux
-\x1B[38;5;214mbeing judgmental is a sign of life
-\x1B[38;5;214mfreedom is a luxury not a necessity
-\x1B[38;5;214mdrama often obscures the real issues
-\x1B[38;5;214mwith perseverance you can discover any truth
-\x1B[38;5;214mhumanism is obsolete
-\x1B[38;5;214myou must disagree with authority figures
-\x1B[38;5;214mmyth can make reality more intelligible
-\x1B[38;5;214mhabitual contempt doesn't reflect a finer sensibility
-\x1B[38;5;214msterilization is a weapon of the rulers
-\x1B[38;5;214myour oldest fears are the worst ones
-\x1B[38;5;214moffer very little information about yourself
-\x1B[38;5;214mthreatening someone sexually is a horrible act
-\x1B[38;5;214mbeing alone with yourself is increasingly unpopular
-\x1B[38;5;214myou are a victim of the rules you live by
-\x1B[38;5;214mto volunteer is reactionary
-\x1B[38;5;214myou have to hurt others to be extraordinary
-\x1B[38;5;214mabuse of power comes as no surprise
-\x1B[38;5;214mrecluses always get weak
-\x1B[38;5;214mawful punishment awaits really bad people
-\x1B[38;5;214mchildren are the most cruel of all
-\x1B[38;5;214mthe cruelest disappointment is when you let yourself down
-\x1B[38;5;214mgo all out in romance and let the chips fall where they may
-\x1B[38;5;214mthe only way to be pure is to stay by yourself
-\x1B[38;5;214mspending too much time on self-improvement is antisocial
-\x1B[38;5;214mknowing yourself lets you understand others
-\x1B[38;5;214mresolutions serve to ease our conscience
-\x1B[38;5;214mwar is a purification rite
-\x1B[38;5;214mgiving free rein to your emotions is an honest way to live
-\x1B[38;5;214mpeople who go crazy are too sensitive
-\x1B[38;5;214mit's better to study the living fact than to analyze history
-\x1B[38;5;214mmen are not monogamous by nature
-\x1B[38;5;214mclass action is a nice idea with no substance
-\x1B[38;5;214mdreaming while awake is a frightening contradiction
-\x1B[38;5;214millness is a state of mind
-\x1B[38;5;214myou are responsible for constituting the meaning of things
-\x1B[38;5;214mit's good to give extra money to charity
-\x1B[38;5;214mit's better to be a good person than a famous person
-\x1B[38;5;214moften you should act like you are sexless
-\x1B[38;5;214mpeople who don't work with their hands are parasites
-\x1B[38;5;214mmonomania is a prerequisite of success
-\x1B[38;5;214mchasing the new is dangerous to society
-\x1B[38;5;214mrevolution begins with changes in the individual
-\x1B[38;5;214mselflessness is the highest achievement
-\x1B[38;5;214msymbols are more meaningful than things themselves
-\x1B[38;5;214ma strong sense of duty imprisons you
-\x1B[38;5;214mautomation is deadly
-\x1B[38;5;214mopacity is an irresistible challenge
-\x1B[38;5;214mmurder has its sexual side
-\x1B[38;5;214mat times inactivity is preferable to mindless functioning
-\x1B[38;5;214mmostly you should mind your own business
-\x1B[38;5;214mthe mundane is to be cherished
-\x1B[38;5;214mselfishness is the most basic motivation
-\x1B[38;5;214msloppy thinking gets worse over time
-\x1B[38;5;214myou can't expect people to be something they're not
-\x1B[38;5;214mambivalence can ruin your life
-\x1B[38;5;214munquestioning love demonstrates largesse of spirit
-\x1B[38;5;214mlabor is a life-destroying activity
-\x1B[38;5;214mgovernment is a burden on the people
-\x1B[38;5;214mdecency is a relative thing
-\x1B[38;5;214myour actions ae pointless if no one notices
-\x1B[38;5;214mdying should be as easy as falling off a log
-\x1B[38;5;214martificial desires are despoiling the earth
-\x1B[38;5;214mcategorizing fear is calming
-\x1B[38;5;214mit's just an accident that your parents are your parents
-\x1B[38;5;214meven your family can betray you
-\x1B[38;5;214mbad intentions can yield good results
-\x1B[38;5;214mif you have many desires your life will be interesting
\x1B[92mMate Light\x1B[93m@\x1B[92mPlay store or \x1B[94;101mtcp://ml.jaseg.net:1337\x1B[0;91m ♥
-\x1B[38;5;214mit's not good to operate on credit
-\x1B[38;5;214mdescription is more important than metaphor
-\x1B[38;5;214mhiding your emotions is despicable
-\x1B[38;5;214mthe desire to reproduce is a death wish
-\x1B[38;5;214mpush yourself to the limit as often as possible
-\x1B[38;5;214mextreme behavior has its basis in pathological psychology
-\x1B[38;5;214mthere's nothing redeeming in toil
-\x1B[38;5;214myou are guileless in your dreams
-\x1B[38;5;214manything is a legitimate area of investigation
-\x1B[38;5;214mdeviants are sacrificed to increase group solidarity
-\x1B[38;5;214myou can't fool others if you're fooling yourself
-\x1B[38;5;214myou can understand someone of your sex only
-\x1B[38;5;214mraise boys and girls the same way
-\x1B[38;5;214mit's not good to hold too many absolutes
-\x1B[38;5;214mkilling is unavoidable but nothing to be proud of
-\x1B[38;5;214myou should study as much as possible
-\x1B[38;5;214malienation produces eccentrics or revolutionaries
-\x1B[38;5;214mtimidity is laughable
-\x1B[38;5;214mfathers often use too much force
-\x1B[38;5;214mgrass roots agitation is the only hope
-\x1B[38;5;214mstrong emotional attachment stems from basic insecurity
-\x1B[38;5;214mrechanneling destructive impulses is a sign of maturity
-\x1B[92mMate Light\x1B[0m powered by \x1B[95mApple™ \x1B[96miScroll®'
-\x1B[38;5;214msometimes science advances faster than it should
-\x1B[38;5;214ma sincere effort is all you can ask
-\x1B[38;5;214myou owe the world not the other way around
-\x1B[38;5;214mmothers shouldn't make too many sacrifices
-\x1B[38;5;214mloving animals is a substitute activity
-\x1B[38;5;214mchange is valuable when the oppressed become tyrants
-\x1B[38;5;214msolitude is enriching
-\x1B[38;5;214msometimes things seem to happen of their own accord
-\x1B[38;5;214mviolence is permissible even desirable occasionally
-\x1B[38;5;214mall things are delicately interconnected
-\x1B[38;5;214mplaying it safe can cause a lot of damage in the long run
-\x1B[38;5;214mdecadence can be an end in itself
\x1B[92mMate Light\x1B[0;91m ♥ \x1B[92mUnicode
-\x1B[38;5;214meveryone's work is equally important
-\x1B[38;5;214mtaking a strong stand publicizes the opposite position
-\x1B[38;5;214mpain can be a very positive thing
-\x1B[38;5;214mclass structure is as artificial as plastic
-\x1B[38;5;214mthe world operates according to discoverable laws
-\x1B[38;5;214mteasing people sexually can have ugly consequences
-\x1B[38;5;214mredistributing wealth is imperative
-\x1B[38;5;214maction causes more trouble than thought
-\x1B[38;5;214mignoring enemies is the best way to fight
-\x1B[38;5;214mnoise can be hostile
-\x1B[38;5;214mwishing things away is not effective
-\x1B[38;5;214mit is a gift to the world not to have babies
-\x1B[38;5;214mthe sum of your actions determines what you are
-\x1B[38;5;214ma name means a lot just by itself
-\x1B[38;5;214mthinking too much can only cause problems
-\x1B[38;5;214msin is a means of social control
-\x1B[38;5;214mchildren are the hope of the future
-\x1B[38;5;214min some instances it's better to die than to continue
-\x1B[38;5;214mself-awareness can be crippling
-\x1B[38;5;214mprivate property created crime
-\x1B[38;5;214mlow expectations are good protection
-\x1B[38;5;214meverything that's interesting is new
-\x1B[38;5;214mdon't place to much trust in experts
-\x1B[38;5;214mstupid people shouldn't breed
-\x1B[38;5;214ma relaxed man is not necessarily a better man
-\x1B[38;5;214mleisure time is a gigantic smoke screen
-\x1B[38;5;214mexceptional people deserve special concessions
-\x1B[38;5;214mstasis is a dream state
-\x1B[38;5;214mgood deeds eventually are rewarded
-\x1B[38;5;214menjoy yourself because you can't change anything anyway
-\x1B[38;5;214mthe new is nothing but a restatement of the old
-\x1B[38;5;214mit's crucial to have an active fantasy life
-\x1B[38;5;214mworrying can help you prepare
-\x1B[38;5;214minheritance must be abolished
-\x1B[38;5;214mpeople are boring unless they are extremists
-\x1B[38;5;214mconfusing yourself is a way to stay honest
-\x1B[38;5;214mstarvation is nature's way
-\x1B[38;5;214mhumor is a release
-\x1B[38;5;214mcrime against property is relatively unimportant
-\x1B[38;5;214mat times your unconsciousness is truer than your conscious mind
-\x1B[38;5;214mself-contempt can do more harm than good
-\x1B[38;5;214mtalking is used to hide one's inability to act
-\x1B[38;5;214mthe idea of revolution is an adolescent fantasy
-\x1B[38;5;214mif you live simply there is nothing to worry about
-\x1B[38;5;214ma single event can have infinitely many interpretations
-\x1B[38;5;214mgoing with the flow is soothing but risky
-\x1B[38;5;214mmanual labor can be refreshing and wholesome
-\x1B[38;5;214mpotential counts for nothing until it's realized
-\x1B[38;5;214myou are the past present and future
-\x1B[38;5;214mtechnology will make or break us
-\x1B[38;5;214mevery achievement requires a sacrifice
-\x1B[38;5;214mthe family is living on borrowed time
-\x1B[38;5;214mphysical culture is second best
-\x1B[38;5;214munique things must be the most valuable
-\x1B[38;5;214ma solid home base builds a sense of self
-\x1B[38;5;214mthe idiosyncratic has lost its authority
-\x1B[38;5;214mlooking back is the first sign of aging and decay
-\x1B[38;5;214mrepetition is the best way to learn
-\x1B[38;5;214mknowledge should be advanced at all costs
-\x1B[38;5;214mif you aren't political your personal life should be exemplary
-\x1B[38;5;214mboredom makes you do crazy things
-\x1B[38;5;214myou must be intimate with a token few
-\x1B[38;5;214myou can live on through your descendants
-\x1B[38;5;214mseparatism is the way to a new beginning
-\x1B[38;5;214mthe idea of transcendence is used to obscure oppression
-\x1B[38;5;214mpolitics is used for personal gain
-\x1B[38;5;214meating too much is criminal
-\x1B[38;5;214mimposing order is man's vocation for chaos is hell
-\x1B[38;5;214myou don't know what's what until you support yourself
-\x1B[38;5;214mif you can't leave your mark give up
-\x1B[38;5;214ma little knowledge can go a long way
-\x1B[38;5;214musing force to stop force is absurd
-\x1B[38;5;214mmorals are for little people
-\x1B[38;5;214mwords tend to be inadequate
-\x1B[38;5;214memotional responses ar as valuable as intellectual responses
-\x1B[92mMate Light\x1B[0m powered by \x1B[95mMicrosoft™ \x1B[96mMarquee Manager® Professional OEM
-\x1B[38;5;214mthe most profound things are inexpressible
-\x1B[38;5;214mfaithfulness is a social not a biological law
-\x1B[38;5;214mrelativity is no boon to mankind
-\x1B[38;5;214mmoderation kills the spirit
+\x1B[92mMate Light\x1B[0;91m ♥ \x1B[92mANSI\x1B[0m \x1B[0;92;33;5mescape\x1B[0m \x1B[96msequences
+A customer enters a pet shop.
+\x1B[92m'Ello, I wish to register a complaint.
+(The owner does not respond.)
+\x1B[92m'Ello, Miss?
+\x1B[93mWhat do you mean "miss"?
+\x1B[92m(pause)I'm sorry, I have a cold. I wish to make a complaint!
+\x1B[93mWe're closin' for lunch.
+\x1B[92mNever mind that, my lad. I wish to complain about this parrot what I purchased not half an hour ago from this very boutique.
+\x1B[93mOh yes, the, uh, the Norwegian Blue...What's,uh...What's wrong with it?
+\x1B[92mI'll tell you what's wrong with it, my lad. 'E's dead, that's what's wrong with it!
+\x1B[93mNo, no, 'e's uh,...he's resting.
+\x1B[92mLook, matey, I know a dead parrot when I see one, and I'm looking at one right now.
+\x1B[93mNo no he's not dead, he's, he's restin'! Remarkable bird, the Norwegian Blue, idn'it, ay? Beautiful plumage!
+\x1B[92mThe plumage don't enter into it. It's stone dead.
+\x1B[93mNononono, no, no! 'E's resting!
+\x1B[92mAll right then, if he's restin', I'll wake him up! (shouting at the cage) 'Ello, Mister Polly Parrot! I've got a lovely fresh cuttle fish for you if you show...
+(owner hits the cage)
+\x1B[93mThere, he moved!
+\x1B[92mNo, he didn't, that was you hitting the cage!
+\x1B[93mI never!!
+\x1B[92mYes, you did!
+\x1B[93mI never, never did anything...
+\x1B[92m(yelling and hitting the cage repeatedly) 'ELLO POLLY!!!!! Testing! Testing! Testing! Testing! This is your nine o'clock alarm call!
+(Takes parrot out of the cage and thumps its head on the counter. Throws it up in the air and watches it plummet to the floor.)
+\x1B[92mNow that's what I call a dead parrot.
+\x1B[93mNo, no.....No, 'e's stunned!
+\x1B[92mSTUNNED?!?
+\x1B[93mYeah! You stunned him, just as he was wakin' up! Norwegian Blues stun easily, major.
+\x1B[92mUm...now look...now look, mate, I've definitely 'ad enough of this. That parrot is definitely deceased, and when I purchased it not 'alf an hour ago, you assured me that its total lack of movement was due to it bein' tired and shagged out following a prolonged squawk.
+\x1B[93mWell, he's...he's, ah...probably pining for the fjords.
+\x1B[92mPININ' for the FJORDS?!?!?!? What kind of talk is that?, look, why did he fall flat on his back the moment I got 'im home?
+\x1B[93mThe Norwegian Blue prefers keepin' on it's back! Remarkable bird, id'nit, squire? Lovely plumage!
+\x1B[92mLook, I took the liberty of examining that parrot when I got it home, and I discovered the only reason that it had been sitting on its perch in the first place was that it had been NAILED there.
+\x1B[93mWell, o'course it was nailed there! If I hadn't nailed that bird down, it would have nuzzled up to those bars, bent 'em apart with its beak, and VOOM! Feeweeweewee!
+\x1B[92m"VOOM"?!? Mate, this bird wouldn't "voom" if you put four million volts through it! 'E's bleedin' demised!
+\x1B[93mNo no! 'E's pining!
+\x1B[92m'E's not pinin'! 'E's passed on! This parrot is no more! He has ceased to be! 'E's expired and gone to meet 'is maker! 'E's a stiff! Bereft of life, 'e rests in peace! If you hadn't nailed 'im to the perch 'e'd be pushing up the daisies! 'Is metabolic processes are now 'istory! 'E's off the twig! 'E's kicked the bucket, 'e's shuffled off 'is mortal coil, run down the curtain and joined the bleedin' choir invisible!! THIS IS AN EX-PARROT!!
+\x1B[93mWell, I'd better replace it, then. (he takes a quick peek behind the counter) Sorry squire, I've had a look 'round the back of the shop, and uh, we're right out of parrots.
+\x1B[92mI see. I see, I get the picture.
+\x1B[93m(pause) I got a slug.
+\x1B[92mPray, does it talk?
+\x1B[93mNnnnot really.
+\x1B[92mWELL IT'S HARDLY A BLOODY REPLACEMENT, IS IT?!!???!!?
+\x1B[93mN-no, I guess not. (gets ashamed, looks at his feet)
+\x1B[92mWell.
+\x1B[93m(quietly) D'you.... d'you want to come back to my place?
+\x1B[92m(looks around) Yeah, all right, sure.
+Alternate ending:
+\x1B[92m(sweet as sugar) Pray, does it talk?
+\x1B[93mNnnnot really.
+\x1B[92mWELL IT'S HARDLY A BLOODY REPLACEMENT, IS IT?!!???!!?
+\x1B[93mLook, if you go to my brother's pet shop in Bolton, he'll replace the parrot for you.
+\x1B[92mBolton, eh? Very well.
+(The customer leaves.)
+(The customer enters the same pet shop. The owner is putting on a false moustache.)
+\x1B[92mThis is Bolton, is it?
+\x1B[93m(with a fake mustache) No, it's Ipswitch.
+\x1B[92m(looking at the camera) That's inter-city rail for you.
+(Mr. Praine goes to the train station. He addresses a man standing behind a desk marked "Complaints".)
+\x1B[92mI wish to complain, British-Railways Person.
+\x1B[93mI DON'T HAVE TO DO THIS JOB, YOU KNOW!!!
+\x1B[92mI beg your pardon...?
+\x1B[93mI'm a qualified brain surgeon! I only do this job because I like being my own boss!
+\x1B[92mExcuse me, this is irrelevant, isn't it?
+\x1B[93mYeah, well it's not easy to pad these python files out to 150 lines, you know.
+\x1B[92mWell, I wish to complain. I got on the Bolton train and found myself deposited here in Ipswitch.
+\x1B[93mNo, this is Bolton.
+\x1B[92m(to the camera) The pet shop man's brother was lying!!
+\x1B[93mCan't blame British Rail for that.
+\x1B[92mIn that case, I shall return to the pet shop!
+\x1B[92mI understand this IS Bolton.
+\x1B[93m(still with the fake mustache) Yes?
+\x1B[92mYou told me it was Ipswitch!
+\x1B[93m...It was a pun.
+\x1B[92m(pause) A PUN?!?
+\x1B[93mNo, no...not a pun...What's that thing that spells the same backwards as forwards?
+\x1B[92m(Long pause) A palindrome...?
+\x1B[93mYeah, that's it!
+\x1B[92mIt's not a palindrome! The palindrome of "Bolton" would be "Notlob"!! It don't work!!
+\x1B[93mWell, what do you want?
+\x1B[92mI'm not prepared to pursue my line of inquiry any longer as I think this is getting too silly!
+Sergeant-Major: Quite agree, quite agree, too silly, far too silly... (takes customer by the arm) Come on, you, you've got to go do another sketch now! Come on... (he walks off stage left, followed by the director and cameramen, leaving the owner alone on the set)
+\x1B[93m(to the audience) Well! I never wanted to do this in the first place. I wanted to be... a lumberjack!
+(he takes off his white lab coat to reveal a checkered shirt and suspenders under it)
+Floating down the mighty rivers of British Columbia! With my best girl by my side!...
diff --git a/host/server.py b/host/server.py
index 456eedb..7efca5e 100755
--- a/host/server.py
+++ b/host/server.py
@@ -73,6 +73,7 @@ class TextRenderer:
def __iter__(self):
for i in range(-DISPLAY_WIDTH, self.width):
+ #print('Rendering text @ pos {}'.format(i))
yield render_text(self.text, i)
class MateLightUDPServer:
@@ -134,7 +135,7 @@ class MateLightTCPTextHandler(BaseRequestHandler):
data = str(self.request.recv(1024).strip(), 'UTF-8')
addr = self.client_address[0]
if len(data) > 140:
- self.request.sendall('TOO MUCH INFORMATION!\n')
+ self.request.sendall(b'TOO MUCH INFORMATION!\n')
return
log('\x1B[95mText from\x1B[0m {}: {}\x1B[0m'.format(addr, data))
renderqueue.append(TextRenderer(data))
@@ -150,11 +151,11 @@ userver = MateLightUDPServer()
userver.start()
defaultlines = [ TextRenderer(l[:-1].replace('\\x1B', '\x1B')) for l in open('default.lines').readlines() ]
-random.shuffle(defaultlines)
-defaulttexts = itertools.cycle(itertools.chain(*defaultlines))
+#random.shuffle(defaultlines)
+defaulttexts = itertools.chain(*defaultlines)
if __name__ == '__main__':
- #print('\033[?1049h'+'\n'*9)
+ print('\033[?1049h'+'\n'*9)
while True:
if renderqueue:
renderer = renderqueue.popleft()
@@ -166,11 +167,18 @@ if __name__ == '__main__':
foo = os.urandom(640)
frame = bytes([v for c in zip(list(foo), list(foo), list(foo)) for v in c ])
else:
- frame = next(defaulttexts)
+ try:
+ frame = next(defaulttexts)
+ except StopIteration:
+ defaultlines = [ TextRenderer(l[:-1].replace('\\x1B', '\x1B')) for l in open('default.lines').readlines() ]
+ #random.shuffle(defaultlines)
+ defaulttexts = itertools.chain(*defaultlines)
sendframe(frame)
- #printframe(next(defaulttexts))
+# printframe(frame)
continue
+# sleep(0.1)
for frame in renderer:
sendframe(frame)
- #printframe(frame)
+# printframe(frame)
+# sleep(0.1)