Showing posts with label computers. Show all posts
Showing posts with label computers. Show all posts

Saturday, September 15, 2012

The Fossil Project, Part III: Frotz and Zork

I was hoping to use the Fossil to play some interactive fiction, but I pretty much put it on the back burner until I watched Jason Scott's Get Lamp and remembered, Oh yeah, they used to run these things off floppy disks and tapes back in the day. How hard can this be?

For starters, it's not like I can actually get floppy disks or tapes for this stuff without paying lots of money on eBay, at which point I would likely wait anxiously for its arrival only to discover it doesn't work with FreeBSD.



I figured there must be some way to get floppy disk images for Unix, or some other means of playing it directly. I didn't really have hope I'd get a general interpreter for z-code files, but I also didn't know where I'd find a plain old regular program-version of Zork or anything else. And I really, really wanted to play Zork.

I posted a question on the intfiction.org forums that probably revealed my great ignorance of what I was doing. First I got a hint towards my Internet-connecting problem - it basically gives me hope that one of the other old computers lying around here might have a compatible network card, or that I'll be able to find one somewhere that's compatible - and then the great Zarf, Andrew Plotkin himself, answered (how sad is it that I still haven't played Shade?).



Ah, that reminded me I could just Google "FreeBSD Frotz" and see if anything useful came up - anything precompiled. I managed to find a section on the FreeBSD site full of ports of various applications and this horrifying thing appeared when I clicked on the Frotz one:



Either something was missing or I didn't (don't) understand makefiles, and I didn't really feel like installing the entire ports tree (even though it's rather lightweight and looks quite easy).   It was apparent I had to give Zarf's link a shot after all.

I unpacked the tarball file on my Mac and looked at the install instructions. Unix with an ANSI C compiler? Check. POSIX-compliant version of make? Um. I hope so. SYSV-derived curses library? No idea what that means but it's not completely necessary ("Maybe you'd like to experience what it's like to play Adventure on a teletype" = true) so I just half-hoped FreeBSD had a sufficient curses library and moved on. I looked this up later, by the way, and it's got nothing to do with swearing at the parser.

The install instructions then informed me that precompiled Frotz for FreeBSD is available in the ports tree. I already knew that, obviously, but it made me toy once again with just installing all the ports.



But hey, I figured this tarball thing sounded reasonable enough to work, so I burned the tarball to a CD to transfer it to the Fossil (literally the fastest way I have to transfer data to it…no offense meant to floppies and tapes).

I had to learn about mounting CDs in FreeBSD, and edit my first makefile (in vi!). I was feeling quite out of my depth, but when I held my breath and typed "make" in the proper directory, everything went fine. I then installed it, and again, nothing broke.

Now to deal with Zorkifying my Frotz.

I found a download of all the Infocom games in ZCode format, which I am not linking because the copyright for these games might yet be held by Activision. That aside, I'm definitely looking forward to trying A Mind Forever Voyaging, Hitchhiker's Guide, Planetfall, and all the Zork iterations.

There was some more CD-burning and some very tedious copying of games to the Fossil, but before too long (and after some command-line "hunt the verb," a favorite game of every IF player and Unix-terminal newbie), my dear Fossil was telling me I was standing in an open field outside a white house. I played several turns and saved it and so far everything looks totally functional. And I am all kinds of psyched.



My thanks to Zarf and everyone else who posted in that original thread (RealNC, simvig, UnwashedMass, frotz, and ThomasDickey). The interactive fiction crowd is one of the most helpful (and friendly) online communities I've ever seen.

Monday, August 27, 2012

The Fossil Project, Part II: Choosing and Installing FreeBSD

I decided to install a variation of Unix on the Fossil (if this means nothing to you, read this post first), and I decided I didn't want it to have a GUI because I wanted to learn Unix commands with nothing to lean on.  I also have this great copy of Unix for Dummies (4th edition! copyright 1998! bizarre and fantastic gift from someone) that assumes no GUI, so it seemed like a good route to take.  After all, why do a project like this if it's not more difficult than necessary?

The book, however, assumes that you've been saddled with Unix by someone at your office and just have to figure out how to use it, so the choosing and installing of the new OS was up to me.  I did what anyone else would do - I took the question to the Unix/Linux node of the StackExchange network.  I put in my requirements and the specs of the machine as far as I knew, and posed my very simple question:


I got quite a lot of answers.  Some were more helpful than others, of course, and somehow the one that got the most upvotes was entirely based on how I really could have a GUI if I wanted.



I've seen more of this than makes sense to me, this thing with people assuming I secretly want a GUI but just don't believe in my machine enough.  I commented on the post pretty quickly that I specifically asked for no GUI, but it still got a bunch of upvotes.

Of course, I get to accept whatever answer I like, and so I started with the one that looked most painless - a suggestion of FreeBSD.  I figured if it didn't work I'd try ArchLinux next, if my machine could handle it, or Gentoo, or whatever else was suggested by the fine and helpful people of the StackExchange (which is a thousand times better than a forum for actually getting questions answered).

I went through the process of downloading the big installation of FreeBSD - dvd1 - which would include all the documentation and a bunch of packages besides the OS itself, as well as a small installation (disc1) with just the OS and docs.  Knowing the Fossil has no network card and being uncertain if I'd ever be able to connect it to the 'net, I wanted to install as much as would fit right off the bat.  I burned dvd1 to a DVD, booted up, and inserted the DVD into the CD drive.

Windows 95 booted.

Well, okay, that makes sense, I just needed to change the boot order.  So I rebooted, went into the BIOS, and put the CD drive first.  And...go!

Windows 95 booted.

Maybe I didn't put the DVD in fast enough.  I rebooted again.

Windows 95 booted.

The CD drive literally only reads CDs, not DVDs.  "It's red lasers!  What's the difference!?" I complained to someone I know, who laughed and said "We're young," clearly indicating that we expect things to work that once did not.

Fine.  Minimal installation from a CD it is.  And this time it worked, and installed fairly painlessly, and has no GUI by default.  I haven't run into any problems yet, except that the only text editor is vi - which sounds a lot worse that it really is.  I don't hate vi.  So I count this as a win.


Thank you, timmmay, for your perfect and simple answer, and to Sardathrion for clarifying which of timmmay's suggestions to take.  Of course, now that I have FreeBSD, what do I DO with the thing?  That shall be answered in near-future posts.


Friday, August 24, 2012

The Fossil Project, Part I: First Computer Disassembly/Re-Assembly Experience

Hello, all.  It's been a while.  I've been working on a new pet project to learn some things about computers that I didn't know before, so I'll have plenty of blog posts in the near future relating to that.  This is the first one.

It begins with a machine.  Specifically, this is the computer I used as a kid to play games like Ping & Kooky's Cuckoo Zoo and Richard Scarry's Busytown, and my father used it for whatever mundane things people did with computers that didn't connect to the Internet.  I think it had some kind of extremely basic CAD software and Microsoft Office.  Parts of it are probably fifteen years old (or more), but it's been upgraded over time to have a zippy 133MHz processor, and it ran Windows 95 pretty okay.  I'm past-tensing the software because now it's running FreeBSD, but that's a story for another time.

Anyway, I was a counselor for my church's Youth Camp this year, and I needed to choose a topic for my teach-me group.  Every year there are several little four-day classes that the youth get to attend during the week, and for my first couple of years as counselor I did jewelry making.  This year, for various reasons, all kinds of possibilities were opened up to me.  Comic-book drawing and objected-oriented programming for junior highers were high on my list until I got an email asking me to do the junior high counterpart to the new senior high class on disassembling computers.  I'd never disassembled a computer before, so of course I said yes.

For reasons fairly beyond my control it ended up getting canceled (and I ended up assisting with archery), but this was the beginning of the Fossil's resurrection.  My dad decided he was officially finished with this computer and that I could allow junior highers to pull it apart if I wanted, so a couple of days before leaving for Youth Camp I began the process of learning to disassemble and re-assemble a computer.  Thank God my dad helped me or it would probably still be in pieces on the kitchen table.  Here's the saga as I tracked it with pencil and paper in real-time on 31 May and 1 June, 2012 (with minimal corrections to grammar and the like).  Several bits of information are missing because I forgot to write them down, but you get the idea.


Day 1

20:42 - Il commence!
21:07 - I should have made notes about what ATA cords go where.  I just wanted these stupid ribbons out of the way (this computer is way pre-SATA) but I'm going to be upset by the time reassembly begins.
21:14 - Power supply plugs into the motherboard via two separate plugs that look the same except for the colors of the cables.  I hope I don't fry it on reassembly.
21:25 - Just removed the tape drive.  Tape drive.  Tape.  Drive.
21:32 - The guy who designed the end of the cord that connects the CD drive to the motherboard should be punched in the head.  It's nigh impossible to unplug it from the motherboard because you have to squeeze it from the front and back instead of the sides.  With a pair of needle-nose pliers.
21:43 - The floppy drive...oh, you're laughing.  I'll wait.  Yes, the floppy drive's card is connected to it by a jack that has a tab on the bottom of it.  It must be pushed down with a flathead screwdriver.
22:08 - I let a How I Met Your Mother rerun distract me, but I am now removing expansion cards.  I lack an antistatic wrist strap so I'm touching grounded metal like a superstitious person.
22:19 - There is a dead spider in the case and I think I can remove it using toothpicks as chopsticks.
22:22 - OH DEAR LINUS IT'S ALIVE no, I'm just kidding, it's all dead and crunchy.
22:29 - Onto the RAM.  Two sticks are different from the other two and they don't alternate.  I don't understand.
22:45 - Ohhh the CPU is under the fan.  On a side note, I was expecting to see a chipset with a northbridge and southbridge and basically nothing looks like the layout shown in the PC Builder's Bible from 2008.  My dad was sort of helping - answering questions - but now he's watching King of Queens and I'm flying fairly solo.
23:07 - I'ma just leave the motherboard right where it is.  Commence reassembly!
23:54 - Cards are in properly, I hope.  RAM is in.  Floppy drive is in, but I can't say I'm going to test it.
0:56 - I'm actually guessing where things go at this point.  I should have taken better photos of the ribbons.
2:02 - Giving up for the night.  Somehow 5 drives were connected in here.  I think.  Maybe one wasn't.


Day 2

20:46 - Il commence - deux!
20:58 - Mysteries of unconnected cords - solved!  Between my dad and I we figured it out.  I think.  We'll test it shortly.
21:13 - Moment of truth.
21:15 - Oh eff.
[We turned it on and literally nothing happened. At this point I received a phone call from someone at church.]
21:17 - ahahaha the teach me group is canceled.
21:22 - Oh for...like an idiot, the power supply was plugged in incorrectly (off by a pin).  Now it turns on, but the hard drive won't talk.
21:34 - Drives now spinning (ribbon was backwards in motherboard) but nothing on screen.
21:49 - Got distracted by Santana's no-hitter - first in Mets history!
22:06 - Unplugged all the drives except for one hard drive, and the BIOS finally works properly.  Wish the C drive were labeled.
22:18 - Starting Windows 95!
22:24 - The motherboard is racist.  White is master, black is slave.  I will always remember this.
22:38 - Plugged in the other drives.  No BIOS.  Come on!
22:43 - Unplugged tape and CD drives.  Works.  Next!
22:47 - Tape drive != problem.  Must be CD drive.  But why!?
22:49 - Oh cool, my hands smell like ATA ribbons.
22:52 - Ah yes, plug in CD drive -> BIOS turns into the robot from the Asimov story "Runaround."  Or maybe that's us.  Maybe the CD drive was the issue the entire time.  We will die on Mercury's surface.
22:57 - The CD-ROM drive's ribbon goes in backwards relative to the hard drive ribbon, which is right next to it.  Powell and Donovan.  That's us.  Except less intelligent.  On the plus side, I didn't kill any components!  Mission accomplished.


Wednesday, May 5, 2010

Good Programming Practice

Henceforth, I intend to post an entry every Wednesday and Saturday. I expect you folks to hold me to it, should I forget or ignore this self-imposed obligation.

Without further ado, here is this entry!

I am by no means a professional programmer. I recently finished Computer Science I at my university, and I struggled through it. In my struggles, though, I learned two major things that help with good program design, and I would like to pass them on to other student programmers. I'm all for learning things on your own, but sometimes it's better to learn from other people's mistakes.

Quick note: my CS1 class used C, but these thoughts should be useful for any programming language that uses functions (or methods), including some scripting languages.

Thing Number 1: Block Diagrams

Block diagrams: use them. Before you start coding your project, look at what you have to do, come up with a design, and draw boxes and diamonds and arrows, with simple words and conditionals, visually representing what it is you intend to do. Basically, imagine a flow chart that does what your program will do. You'll figure out very quickly if the vague idea you thought would work actually makes sense, and it'll help you figure out where you are being inefficient (i.e. did you draw the same box in two places, and can you make that not happen?). When it comes time to actually code, you can follow your block diagram for what to code next and what connects to where. It'll also make it easier for you to figure out some of the functions you will need, which brings me to...

Thing Number 2: Functions

Functions: Use them, liberally. I used to be in the habit of making my main() entirely too long, stuffing as much code as possible into it, and not understanding why functions were really useful except in certain special circumstances. The way I coded made my work more difficult, as I tried to read my code and keep track of what I had done, and it made debugging far more ridiculous than it should have been. Now, whenever I have a chunk of code that does one definable thing, I make it into a function. Determine input (if necessary), test the output (or what was printed/changed if it is void). It makes testing/debugging easier, because you can test each function essentially independently of the rest of the program. When everything is in main(), it tends to get so wrapped up in the rest of what you've written that testing a particular section of code involves a lot of commenting things out, and is a pain in the ASCII. Functions also just make things more organized. "Gee, where's the chunk of code that handles checking out a customer?" Why, it's the the checkout() function that I wrote. "I need to initialize a few structs." It's only a few lines of code, but it's much neater to keep it all in an init() function.

Give it a whirl, little programmy folks, and if you have anything to add, clarify, or argue against, please feel free to comment!

Thursday, February 18, 2010

Analogies for Pointers in Computer Science

As part of an argument with an acquaintance for why C is better than Java, and why it is worth the hassle to use pointers, I quickly came up with a few analogies for pointers and why they are cool. My programming prof liked them, so I am providing them here for your enjoyment. If you don't know what a pointer is, see Wikipedia.

On using pointers:
  • +It's like texting your roommate to say "There's cake in the fridge if you want some" instead of actually bringing him/her the cake.
  • +It's like passing around a kite string, and then everybody gets to fly the kite without moving the actual kite at all, just the string.
  • +It's like Rickrolling in that you can pass around the same link with many names, and still end up in the same place.
If you have any more, you should totally add them in a comment!

(And if you want to use these for your class or tutorial, feel free, but please cite me!)

Friday, January 8, 2010

Quick Ubuntu Update - Scrolling

Yesterday I discovered that my Aspire One's bizarre touch-scrolling technique (start in the upper right corner and make a clockwise circle to scroll down, counter-clockwise to scroll up) doesn't appear to work in Ubuntu Netbook Remix.

Instead, the rightmost part of the trackpad seems to work as a (much more sensible) straightforward scrollbar--go up to scroll up, go down to scroll down. Win.

Wednesday, January 6, 2010

My Ubuntu Chronicles Thus Far

For Christmas, I got an Acer Aspire One (D250) netbook, and took over most of the hard drive with Ubuntu Netbook Remix (UNR), leaving just 25 gb to Windows XP in case of Windows-only software or catastrophic Linux failure. This is my first time using Linux, so I was hoping for an easy time of it. I have experienced a few highly annoying problems, yet despite that, I find I prefer it to Windows by a wide margin. Not that it takes much, as I've been primarily a Mac girl since 2007. Unix and I just get along (serious props to Bill Joy).

So. Problems:
  • -When I was first attempting to install UNR via Live USB (as this netbook has no optical drive), it absolutely would not work. "Help" and "default" gave me command lines into which I could not type, and no error messages, even when I tried re-downloading the ISO in case it was corrupted. I finally tried hitting tab for more options, since that was about all I hadn't tried, and it brought up a command line into which I could type. The H in "Help" looked highlighted, so I thought I'd try typing that into the command line. Suddenly, it went into boot mode and I was able to install Linux. This should not have worked and makes no sense to me. God smiled upon my computer that day.
  • -Then I couldn't get my wireless to work. It worked in XP, so I knew my hardware wasn't broken. I tried different drivers, this and that, using Synaptic Package Manager to update everything imaginable, until eventually, in Hardware Drivers, a new driver mysteriously showed up, which I tried, and it worked. Go figure.
  • -Now, UNR works flawlessly, except that it doesn't always feel like booting. If it doesn't boot right away, I get a little blinking hyphen and I can't type anything, so I just reboot or shut down/start again with the power button, and eventually I can get it to boot. I don't have this problem with XP, so it must be Linux-specific. It may be related to whether it's hot or cold. I have no idea. I am willing to take suggestions, by the way--this is UNR Karmic Koala. Judging by the solutions to my last two problems, this one probably will be solved by a ridiculous stroke of random.
Non-problems:
  • -Ubuntu Software Center has just put the entire world at my fingertips and most, if not all, of the available programs appear to be free. I haven't installed any yet but I am in love with the possibilities. I can do anything. Thank you, Linux community.
  • -The version of Firefox it came with seems to have a European spell-checker. It gets sad when I use "honor" instead of "honour" or "center" instead of "centre." OpenOffice and gedit, however, recognize the American versions and not the British versions. Fascinating.
  • -The interface is extremely intuitive. I haven't gotten hopelessly lost yet.
  • -I wasn't expecting it to come with as many games as it does. Fantastic time-wasters, those. Fortunately, I think I will be able to avoid them quite well. I am looking forward to trying out the chess program, to see if I like it as much as the Mac one. I'm no chess guru (I'm actually painfully bad at it), but I go through occasional spells where I think I want to get good at it, and those chess programs are great for practicing with something that can't think poorly of me.
  • -The battery life on this seems to be absolutely insane. I can't help but wonder if the meter is inaccurate. I haven't yet tried to use it for seven to eight hours straight, you see; that will likely occur during the coming semester, and I will know if it is lying to me.
  • -Did I mention Ubuntu Software Center?
That essentially sums up my Ubuntu experience so far. Mercifully, it has been positive, despite many warnings that suggested it would be painful. Here's hoping for all the best, as I continue to use this thing!