IWETHEY v. 0.3.0 | TODO
1,095 registered users | 0 active users | 0 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New Old UNIX game archaeology
Anyone remember xbattle? Played this to death on the Sun systems at university.

https://gamicus.fandom.com/wiki/Xbattle

I grabbed the source, but making it build is beyond my ken. I've got all the depends and run autoconf and the configure script, but no dice. I'm all like "but it's right there!" whilst pointing wildly at config.h on the screen.

peter@THOR:~/xbattle$ make
g++ -g -O2 -I/usr/X11/include -c src/player.cc -o obj/player.o
g++ -g -O2 -I/usr/X11/include -c src/replay.cc -o obj/replay.o
g++ -g -O2 -I/usr/X11/include -c src/commandline.cc -o obj/commandline.o
src/commandline.cc:6:10: fatal error: config.h: No such file or directory
6 | #include "config.h"
| ^~~~~~~~~~
compilation terminated.
make: *** [makefile:28: obj/commandline.o] Error 1
peter@THOR:~/xbattle$ ls
COPYRIGHT LICENSE.GPL Makefile.std config.h config.status doc obj
COPYRIGHT.SharePtr Makefile README config.h.in configure install-sh share
INSTALL Makefile.in autom4te.cache config.log configure.ac makefile src
peter@THOR:~/xbattle$


In case the CODE tag has mangled things:

Expand Edited by pwhysall March 29, 2022, 08:49:25 AM EDT
New Something wrong with the $PATH at that line?
--

Drew
Expand Edited by drook March 29, 2022, 09:44:09 AM EDT
New Not the $PATH, but a missing -I.
As one of my old software engineering professors used to tell us, "A different compiler error message is progress."

So I've got it built. Needed to add . (i.e. the current directory) as an include path in the makefile, and sprinkle a few now-mandatory #includes into the source.

Victory! But not quite.

peter@THOR:~/xbattle$ make
g++ -g -O2 -I/usr/X11/include -I. -c src/player.cc -o obj/player.o
g++ -g -O2 -I/usr/X11/include -I. -c src/replay.cc -o obj/replay.o
g++ -g -O2 -I/usr/X11/include -I. -c src/commandline.cc -o obj/commandline.o
g++ -g -O2 -I/usr/X11/include -I. -c src/xbattle.cc -o obj/xbattle.o
g++ -g -O2 -I/usr/X11/include -I. -c src/option.cc -o obj/option.o
g++ -g -O2 -I/usr/X11/include -I. -c src/edit.cc -o obj/edit.o
g++ -g -O2 -I/usr/X11/include -I. -c src/main.cc -o obj/main.o
g++ -g -O2 -I/usr/X11/include -I. -c src/team.cc -o obj/team.o
g++ -g -O2 -I/usr/X11/include -I. -c src/color.cc -o obj/color.o
g++ -g -O2 -I/usr/X11/include -I. -c src/teams.cc -o obj/teams.o
g++ -g -O2 -L/usr/X11/lib -o xbattle obj/player.o obj/replay.o obj/commandline.o obj/xbattle.o obj/option.o obj/edit.o obj/main.o obj/team.o obj/color.o obj/teams.o -lX11 -lm
peter@THOR:~/xbattle$ ls
COPYRIGHT INSTALL Makefile Makefile.in README config config.h.in config.status configure.ac install-sh obj src
COPYRIGHT.SharePtr LICENSE.GPL Makefile.bak Makefile.std autom4te.cache config.h config.log configure doc makefile share xbattle
peter@THOR:~/xbattle$ ./xbattle
Seeding random number generator: 1648581412

Sorry: Must specify at least one team

Try xbattle -help for information on running xbattle

peter@THOR:~/xbattle$ ./xbattle -help
Add show_usge function
peter@THOR:~/xbattle$


Fuckin' nerds.
Expand Edited by pwhysall March 29, 2022, 10:39:11 AM EDT
New Well obviously anyone trying to build apps would know to do that, duh!
--

Drew
New Here's one of the error messages
I will give you a shiny nickel if you can guess how this was resolved in its entirety.

src/option.cc: In constructor ‘Option::Option(std::vector >::const_iterator&, const const_iterator&, bool)’:
src/option.cc:41:32: error: cannot convert ‘std::__cxx11::basic_string::iterator’ {aka ‘__gnu_cxx::__normal_iterator >’} to ‘const char*’
41 | _key.erase( remove(_key.begin(),_key.end(),'-'), _key.end() );
| ~~~~~~~~~~^~
| |
| std::__cxx11::basic_string::iterator {aka __gnu_cxx::__normal_iterator >}
In file included from /usr/include/c++/9/cstdio:42,
from /usr/include/c++/9/ext/string_conversions.h:43,
from /usr/include/c++/9/bits/basic_string.h:6496,
from /usr/include/c++/9/string:55,
from src/types.h:6,
from src/option.h:4,
from src/option.cc:1:
/usr/include/stdio.h:146:32: note: initializing argument 1 of ‘int remove(const char*)’
146 | extern int remove (const char *__filename) __THROW;

| ~~~~~~~~~~~~^~~~~~~~~~
src/option.cc:42:32: error: cannot convert ‘std::__cxx11::basic_string::iterator’ {aka ‘__gnu_cxx::__normal_iterator >’} to ‘const char*’
42 | _key.erase( remove(_key.begin(),_key.end(),'_'), _key.end() );
| ~~~~~~~~~~^~
| |
| std::__cxx11::basic_string::iterator {aka __gnu_cxx::__normal_iterator >}
In file included from /usr/include/c++/9/cstdio:42,
from /usr/include/c++/9/ext/string_conversions.h:43,
from /usr/include/c++/9/bits/basic_string.h:6496,
from /usr/include/c++/9/string:55,
from src/types.h:6,
from src/option.h:4,
from src/option.cc:1:
/usr/include/stdio.h:146:32: note: initializing argument 1 of ‘int remove(const char*)’
146 | extern int remove (const char *__filename) __THROW;
| ~~~~~~~~~~~~^~~~~~~~~~
Expand Edited by pwhysall March 29, 2022, 10:52:24 AM EDT
New mix of gcc and cc usage?
"Science is the belief in the ignorance of the experts" – Richard Feynman
New Nope
New I assume it's related to sizes of various things changing as memory spaces got bigger.
Let's see...

https://github.com/mikemayer67/xbattle/blob/master/README

REVISION NOTES

This is version 6.0.1 of xbattle, by Mike Mayer, based on the version
5.4.1 by Greg Lesher. Much has changed in software developement since
this game was released in 1991. Unfortunatey, this has made xbattle
uncompilable on many platforms. This is a rewrite of 5.4.1 in C++11.
As with the original, it requires the X11 library (and headers).
Unlike the original, it also requires STL (the standard template library).


[...]

BUG FIXES

On some machines the "char" type is assumed signed, while on others it is
assumed unsigned. A new typedef for signed and unsigned char types has
been created.


[...]


Something like that?

Have fun!

Cheers,
Scott.
New Nope :)
New Well, the answer was obvious
The offending file required:

<code>#include <cstring></code>

Because that’s definitely what the error message said.
Expand Edited by pwhysall March 31, 2022, 12:28:33 AM EDT
New Oh dear.
That's the same disease Java has: it tells you what broke but not how or where to fix it. Same thing turned me off Scala, too.

Wade.
New One thing I love about Rust...
The error messages are mostly coherent and self-explanatory.
Ceterum autem censeo pars Republican esse delendam.
New I miss the generic PCC messages
Somewhere in this file you f***** up. I'm not going to tell you where. Go figure it out.

One of my proudest moments in my youth was when I caused the AT&t C compiler to fail. I'd spent the previous 6 months being kicked out of my boss's cubicle, every time I complained. Read the f****** manual. Go back and do it again. But Brian, this is real. There is a problem with the compiler. And then he called his buddies at AT&t.

They agreed and fixed it.
New On the other hand, it was part of a 30-page case statement
There was a command line interface into an editorial program. When the compiler told me my code was too complex for it to figure it out, I knew I crossed a threshold. I was doing this wrong. That was an education.

Edit:

But I just conflated two stories. So let me clarify. Whatever triggered Brian to call AT&t for me was not part of some insane large case statement. I just had a bit of code that caused a compiler failure that should not have. But since I had just spent the previous couple of months learning the language and I thought everything was my problem. I spent a lot of time examining coredumps trying to figure out why my code was getting a memory fault. And I finally figured out it was the compiler generating bad code as opposed to my code doing it. The insane large case statement came about 2 years later. Sorry about that.
Expand Edited by crazy April 5, 2022, 05:24:35 PM EDT
New Didn't you have anyone doing code review?
I'd have been confused after the first page, curious by the second, laughing by the third. "OK, that's a good one! Now show me the real code ... It is? ... But why did ... Right, have a seat."
--

Drew
New Code review? I was the ultimate cowboy coder in those days.
The first year I taught myself Sperry univac mainframe BASIC. I just started typing. This was at a 6-month techie school. I tested out of the basic course and then used basic to generate assembler and Cobol code. I wasn't going to type all that s*** in. I even hired a classmate to type for me occasionally.

But I missed the concept of arrays. So I came up with self-modifying basic code to accomplish the same task that arrays handle, with my variable names having ever incrementing numbers tacked onto them.

Sure, I accomplished some incredible crazy things. And then one of my classmates pointed out the concept of arrays to me. Holy s***! If I missed that, what else did I miss?

So then I learned to read the books. Read the manuals. Joined ACM. Get a couple books a month. Then I worked for a book shop and I got paid in books. Read the programmer guides. Just because I can figure out a way to accomplish a task does not mean it can't be done a lot better. Stand on the shoulders of giants, don't pretend to be one.

A year later I'm running through the xenix tutorials on a Tandy 6000. Teaching myself C. In a tiny company with two competent programmers, two support people, one salesperson, one owner. Those competent programmers had no time for me.

Code review? I don't think it was in the books yet. They just came up with the concept of structured programming at that point. Spaghetti Fortran was the norm. Goto wasn't evil yet.

And self-modifying code was admired.

3 years later I was the only programmer in an office of 30 people. The only tech guy. The only administrator.

I had no experience with any SQL based database. At that point I had done btreive via C and a couple of crap off the shelf dbase systems. And I was tasked with reworking a company. Figure out the database to start off with. Ingress, IBM ( I have thankfully forgotten what that database name is, I can Google query it but it's not worth the trauma) f*** it just came back, DB2, informix, a couple others. Oracle was the one I chose. I had absolutely no background to be making these levels of decisions at that point in my life. I think I was 22 or 23.

I initially negotiated $6,000 for Oracle license plus yearly support. They told me I did not need to actually make the deal at the moment, just be sure I wanted to use it and then make the deal. Take your time. Code a bit. Make sure it works for you.

I was foolish enough to try to build the system via SQL-Forms. I had to construct table driven editorial forms. About two or three hundred of them. So I was going to do it via self-modifying SQL forms. I was an idiot. And I was locking myself into Oracle at that moment. So then I rethought and decided I was going to code it all by hand in C.

I coded for 2 months. I coded for vax VMS, Unix/Xenix, and MS-DOS 3. I had never used a vax before, but since I worked for ziff Davis and they had spare vaxen lying around, it was a possible target. So I coded portably for all of these for both the database access and the screen driving portion. My code could compile on any and when we had system specific interfaces such as the screen it kept everything indirect and drew it all appropriately no matter what system.

I learn to login and run programs on the vax and glance at the help system and compile my code and occasionally edit my code. I learned to use the vax full screen editor and I have to tell you it sucks. It's brilliant though. If I had started with that editor I would probably love it but my default vi fingers do not work with VAX TPU.

As I was doing this I was also learning Oracle. In those days every time you called Oracle tech support and they sent you anything, They also sent you the entire manual set that spanned two boxes and weighed about 80 lb. Every time they sent me anything, they also sent me a manual set. I had them sprinkled around the building.

And when I was ready to pull the trigger Oracle took the price to $20,000 plus the yearly. My boss told me to find an alternative. So I installed a lot of different databases and coded interfaces for each one of them.

When I was done it turns out all the alternative databases wanted the same amount of money as Oracle, they just didn't tell you until you got to that point in negotiation. So I ended up with Oracle.

I wrote a system that included a command line interface into a full screen editorial program. I had to exactly copy the system that was already there and it was horrible. But I had to start with that and then make it better after I moved all the people to it. It took four people ( seasoned professional programmers ) a year to write the system the first time. It took me about 2 months.

I duplicated a Pick system with my hand-coded C/Oracle system. This command line interface had its own macro language. And it was this horrible abortion of working through what that person typed on the command line and figuring out what to do with it. So every possible command or entry of any sort had to be parsed and acted upon. And if it was in the middle of a macro, I was essentially executing an interpreted language and bouncing all over the place. That case statement went on and on and on. Half the time if it matched something, it still need to extract some more stuff and figure out what to do with that and then realize that it was an incorrect direction and then go through the rest of the possibilities in the case statement. I had some serious go-tos in that.

That was when I found out a standard programmer can handle two screens, a printed page. But I could handle about 30 or 40. But it was a bad idea to do it.
Expand Edited by crazy April 5, 2022, 05:18:10 PM EDT
New Mel? Is that you?
Ceterum autem censeo pars Republican esse delendam.
New Oh how I loved Mel
Was it the Royal something typewriter company? And he created the term most pessimism I don't know, it was based on the pessimistic target of the rotating memory drum.
New I learned to code for others after that job
I tried to explain to the HR person that came in to prep for my exit from that job. I wore about six different hats.

You need a programmer, a system administrator, a database administrator, a technical manager, a help desk person and the programmer better know C, Perl, all the Unix command line possibilities as they are in shell scripts all over the place, oh, and this is a new multiprocessor Unix system that is way new cheap desktop technology and is prone to failure. So you better be able to handle the rolling oracle backup system that I created before Oracle had it. There are 30 users right down the hall from you and will walk into your office to try to distract you. They are all nice people. You have to kick them out nicely. Unless there is a real request to be dealt with. You will never have a moment of free time if you don't know how to manage it. There is a once a month production that goes for three straight days. You better be available the entire time. The system will call you if there is a problem. You better be willing to carry the beeper 24 by 7. And don't expect any support from corporate because they don't know s*** about this system and they told me I was on my own when I created it and my boss was fine with that.

She laughed at me. I knew the end was near when that happened.

My boss fought for this system.

I had a mediocre assistant that had been forced upon me at that point so she was going to be in charge when I left. And she was no programmer and a piss poor junior admin. But there was no smoking guns to fire her. She spent 90% of her time writing her unpublished novel. I was not allowed to fire her.

They closed that division about a year after I left. Either I timed it perfectly or there was technical problems after I left.

After that point I spent a couple years building a system and then hiring and managing other programmers. I kept writing my own systems and handing them off to other programmers.

I spent an enormous amount of time recruiting. I visited classes and user groups and interacted with hundreds of people as I handed out my card and tried to attract the best and the brightest. My best perl programmer was an English major in college. And his last name was Pearl. He was born into it. He was tossed at me via a recruiter and his resume was absolutely no mach for the job. But on interview it was obvious and over the years he amazed me again and again. He was one of many.

I also had my failures. So I became very careful.

Bottom line is I never tried to embed and I always try to hire smarter than me.

So everything I wrote had to be easily understood by any programmer that I was willing to hire. And I didn't code obscure to be fancy. But occasionally you have to do table driven regular expressions in closures and that s*** goes wild.
Expand Edited by crazy April 5, 2022, 06:32:43 PM EDT
Expand Edited by crazy April 5, 2022, 06:33:39 PM EDT
Expand Edited by crazy April 5, 2022, 06:35:59 PM EDT
Expand Edited by crazy April 5, 2022, 06:58:52 PM EDT
New Go-tos within a 30-page CASE statement ... [shudder]
--

Drew
New Not just gotos, I had long jumps
Save the stack. Pray you understand what you did with the local variables. Jump hard. Long jump is the ultimate bail maneuver when you are programming in C.

Even better. I knew which address to jump to to reboot the IBM xt. When I ran out of memory I rebooted the box.

There were many computers at the Monmouth county library. The Monmouth county library had many branches. I wrote a program that replaced their card catalogs. It talked to the main Unix systems and told them what was in stock and checked out. It drew a little ascii map of the library and put a little pointer and floated along from where they were to where the book was that they wanted.

When the library opened there was a ceremony. There was a crowd of people. This crowd of people wandered around the library and used my computers to find books. They s*** themselves. That was a wonderful moment.

But occasionally that program would s*** itself. It would run out of memory. So I jumped to the first thousand bytes and shoved a bit of data in a particular location and rebooted the box. I used to teach C courses and explained how to do this to other programmers. I passed this bit of knowledge and many people rebooted boxes because I told them to.
Expand Edited by crazy April 6, 2022, 09:45:54 PM EDT
     Old UNIX game archaeology - (pwhysall) - (20)
         Something wrong with the $PATH at that line? -NT - (drook) - (19)
             Not the $PATH, but a missing -I. - (pwhysall) - (18)
                 Well obviously anyone trying to build apps would know to do that, duh! -NT - (drook) - (17)
                     Here's one of the error messages - (pwhysall) - (16)
                         mix of gcc and cc usage? -NT - (boxley) - (1)
                             Nope -NT - (pwhysall)
                         I assume it's related to sizes of various things changing as memory spaces got bigger. - (Another Scott) - (1)
                             Nope :) -NT - (pwhysall)
                         Well, the answer was obvious - (pwhysall) - (11)
                             Oh dear. - (static) - (10)
                                 One thing I love about Rust... - (InThane) - (9)
                                     I miss the generic PCC messages - (crazy) - (8)
                                         On the other hand, it was part of a 30-page case statement - (crazy) - (7)
                                             Didn't you have anyone doing code review? - (drook) - (6)
                                                 Code review? I was the ultimate cowboy coder in those days. - (crazy) - (5)
                                                     Mel? Is that you? -NT - (InThane) - (2)
                                                         Oh how I loved Mel - (crazy) - (1)
                                                             I learned to code for others after that job - (crazy)
                                                     Go-tos within a 30-page CASE statement ... [shudder] -NT - (drook) - (1)
                                                         Not just gotos, I had long jumps - (crazy)

I’ve heard that Vicks Vapo-Rub tastes exactly like chicken.
210 ms