• Welcome to the new COTI server. We've moved the Citizens to a new server. Please let us know in the COTI Website issue forum if you find any problems.
  • We, the systems administration staff, apologize for this unexpected outage of the boards. We have resolved the root cause of the problem and there should be no further disruptions.

Free Programming Language(s)?

Hey Jim, not bad!

You've got the logic down so you're far ahead of the game. I run on Linux but you can use Notepad or similar and run things in a command window. Many of the scripting languages provide "how to install on windows" directions.

For a language, your biggest issue will be picking one. If you want something simple, Perl, Python, Ruby, or maybe even Javascript can get you going. C, Go, or Java if you want something compiled. The real issue is to pick one you really enjoy. The more you enjoy it the more you'll code, and the better you'll get, which increases your joy.

Don't worry about a language being Object Oriented. Almost all of them are able to run things like you wrote without getting deep into OOP.

Here are some code samples, as long as you don't assume my code is great:

Ruby:
https://github.com/LeamHall/CT_Character_Generator/blob/master/bin/Chargen.rb

Go:
https://github.com/makhidkarun/vargr_names/blob/master/vargr_names.go

PHP:
https://github.com/makhidkarun/NPC_Generator/blob/master/NPC_Generator/Trooper.php
 
Thanks. Programming professors told me I could think logically, but senior year when we had to write a compiler and an assembler were very difficult for me.

I could follow the Ruby code fairly easily.

Years ago I bought a Perl made Easy book... and I got confused. I'll look at some of these and see what I can learn.
 
Jim, if you want to stick to old-school BASIC, there's QB64. Functionally, it's 99% compatible with MS QuickBasic, and better, it's able to be compiled for Windows, Linux, Android and Mac. Compiling it for mach requires a few extra steps to make the command-line executable a double-click to run...
http://QB64.net

Personally, I've mostly switched over to Python these days. But If i'm writing something for sharing, QB64 allows it to go smoothly.
 
Glad you could read the Ruby code. Mine isn't the most awesome, but I try to write readable and reasonable code. The Chargen.rb file in that set does start to move to OOP but it's very light. I could do most everything with a C struct and functions. I'm pushing myself to learn Ruby and OOP though, so trying to move forward a bit at a time.

I'd say play with Ruby for a month and see if you like it. If not, we can find something else to try. Here's a dice roller. It calls a module so th edice function can be shared and in a central location. With those you can probably duplicate much of what you had before. The method "gets" takes data entry, "puts" prints it out. There are some quirks, the string "gets" brings in is a string, even if a number is entered. It also has a newline character that needs to be removed. Once you get that part most everything else is easy.
 
Is there a gui IDE for Ruby ? The installer says it has installed Tcl, but I don't see it. All I see is a command line. I've used them, but I prefer seeing all of the code in large windows.
 
Last edited:
Jim, if you want to stick to old-school BASIC, there's QB64. Functionally, it's 99% compatible with MS QuickBasic, and better, it's able to be compiled for Windows, Linux, Android and Mac. Compiling it for mach requires a few extra steps to make the command-line executable a double-click to run...
http://QB64.net

Personally, I've mostly switched over to Python these days. But If i'm writing something for sharing, QB64 allows it to go smoothly.

I think I looked at this before, but I'm not sure. Downloading it.
 
Are there any freely available, preferably shallow learning curve, programming languages out there that lend themselves to random generators, such as those used for planets and animals? (So they include random number gen).

I have done a lot of professional software development over the last 30 years. One of the most important things it to identify what it is you really want to do.

Are you in fact looking to write code? Or do you want to do:

random generators, such as those used for planets and animals?

If in fact you just want something that will generate random results based on a 'table' of information an extremely simple solution is Inspiration Pad Pro 3.0 which is published by Nbos.

For very simple random tables this is an amazingly simple tool to use. If you want to be able to have something randomly generated in one table and then have an influence on another table it is possible to do that as well (i.e. pass parameters to the table generator).

For my fantasy campaigns I have used IPP for random encounters (depending on terrain, how widely traveled the area is, and season), merchandise available at different types of businesses (plus prices) which vary depending on local and how much wealth there is in a particular place, and weather (which is more of a 'fractal' generation).

And it is free.
 
Is there a gui IDE for Ruby ? The installer says it has installed Tcl, but I don't see it. All I see is a command line. I've used them, but I prefer seeing all of the code in large windows.

Sounds like you're talking about an IDE to write Ruby, not something like RubyTK to do GUI apps, right? A quick looks suggests NetBeans, Eclipse, Komodo (costs), or similar might help. I'll be honest, I use vim, so no real experience with the IDE market. :)
 
Thanks. Programming professors told me I could think logically, but senior year when we had to write a compiler and an assembler were very difficult for me.

I could follow the Ruby code fairly easily.

Years ago I bought a Perl made Easy book... and I got confused. I'll look at some of these and see what I can learn.

Compilers and assembly code are inherently complicated. Some languages and environments put simplified wrappers around them, but the complexity is still there and the simplified wrappers will restrict what you can do.

In general I don't like getting into language wars. To each their own. I used to use Perl extensively, it was my go-to language for almost a decade, but there's no way I would ever recommend it as a first language, or even really at all nowadays. It's a very powerful language, but really not very newbie friendly. It gained ground fast because it was more capable than Unix Bash scripting on it's own and in that super-technical niche it's still a great resource.

Here are few considerations I'd like to suggest:

1. Do you care about cross-platform support? If not, look at the languages best supported on your platform. What does your platform vendor or the platform community suggest? I hesitate about this because platform specific tools are ghettos, but they can be really nice comfortable ghettos.

2. Do you care about desktop or web programming? Not just now, but for future projects? There are plenty of languages with good desktop and web development options.

3. Community. Spend as much time looking into the web community for a language as much as for it's technical advantages and capabilities. Forums, articles, blogs, tutorials. You will be using these heavily if you do anything significant with the language. Make sure these exist, are currently active and will be there to support you. Reddit and Stack Overflow are generally good proxies for gauging this.

4. When you have considered all this and taken into account all the pros and cons, choose Python. Sorry, couldn't resist. Make your own choice. Plenty of people have suggested very strong options. It's all good.

Simon Hibbs
 
I agree with most of what simonh said. I'd avoid OS specific ghettos though. You're going to want to share your code and there are three major and very different platforms available.

The suggestions I gave were all cross-platform. I agree that Perl isn't my first choice, but it is a strong contender for stuff. However, Python and Ruby are easier to read, code, and even more advantageous. The Ruby, Python, and PHP communities are all pretty good, except when they bash me for having an old Ruby. Personal choice for professional reasons, but it gets annoying after a while. Since you've coded a good bit before, Perl is an option.

I like Ruby because I like coding in it. That's not a circular argument, even if it looks odd. I have coded Perl, Python, Ruby, PHP, C, Go, and Bash. I enjoy coding in Ruby so I code in it. I can't stress this enough; code in what you enjoy coding in. All languages have strengths and warts. If you enjoy coding in language X you'll code more, learn more, and then code more.
 
For platform specific tools I was thinking of things like VB, C# and Swift. They're each very high quality, well supported options that aren't going to disappear any time soon. If you want to take advantage of platform specific features they are reasonable options.

For example personally for iOS programming I use Pythonista, a paid-for Python dev environment that runs right there on your phone or iPad. Because it's Python in theory it's cross-platform, but in practice I'm hooking into platform specific graphics and media frameworks. There's no way I'd ever port these anywhere else. On the other hand, I'm keeping my Python skills sharp and those skills are transferrable. Still, Swifty is a great option for programming in the Apple ecosystem. Same goes for C# on Windows.

For me, my programming skills are also a key part of my professional skills set, so my choices for hobby programming are closely linked to that. In the industry I work in Python is a big deal nowadays, but even when it wasn't it was still a useful professional skill to have. For someone working in the Windows ecosystem for example, C# might be the right choice. Open source is a useful advantage as is cross platform. They're not the only factors though.

Simon Hibbs
 
Compilers and assembly code are inherently complicated. Some languages and environments put simplified wrappers around them, but the complexity is still there and the simplified wrappers will restrict what you can do.

In general I don't like getting into language wars. To each their own. I used to use Perl extensively, it was my go-to language for almost a decade, but there's no way I would ever recommend it as a first language, or even really at all nowadays. It's a very powerful language, but really not very newbie friendly. It gained ground fast because it was more capable than Unix Bash scripting on it's own and in that super-technical niche it's still a great resource.

Here are few considerations I'd like to suggest:

1. Do you care about cross-platform support? If not, look at the languages best supported on your platform. What does your platform vendor or the platform community suggest? I hesitate about this because platform specific tools are ghettos, but they can be really nice comfortable ghettos.

2. Do you care about desktop or web programming? Not just now, but for future projects? There are plenty of languages with good desktop and web development options.

3. Community. Spend as much time looking into the web community for a language as much as for it's technical advantages and capabilities. Forums, articles, blogs, tutorials. You will be using these heavily if you do anything significant with the language. Make sure these exist, are currently active and will be there to support you. Reddit and Stack Overflow are generally good proxies for gauging this.

4. When you have considered all this and taken into account all the pros and cons, choose Python. Sorry, couldn't resist. Make your own choice. Plenty of people have suggested very strong options. It's all good.

Simon Hibbs

I will only be doing this on a Windows computer. I would prefer my AMiga, but it needs some work.

Desktop only. I use a php cms for my sites, and let them do the updates.

Community; yeah, I've seen glorious web pages touting particular programming languages. I go to their forums, and hear crickets. Or see a few posts asking if the site/language is still active with no replies.

I've looked at a bit of Python. Not for now. I have redone some of the code for my arduinos, but it was mostly the timing and number of LEDs they lit up for a Halloween item.

I have looked at the free BASICs off and on... and noticed in their forums that people want to do things, which drives development, for things I am not looking for. Leaving out a random number function... ah well.
 
..and don't forget, you don't have to download Javascript at all -- if you can read this, you already have it.

Notepad will work fine to get you started. And anything you write can be used by anyone who can read this as well (to a certain degree).
 
I've had an obsession with random generators since, well, I first got my hands on a computer. (my first home computer was a Sinclair ZX-81, and the first program I wrote for it was a dice roller) I wrote a Traveller sector generator in FORTRAN, back when I worked for Accu-Weather ... it even put out nifty subsector maps on our electrostatic plotter (it's what you had before laser printers ... sort of a cross between a copier, a fax machine, and an accident in a chemical factory). I wrote all sorts of things in all sorts of languages in the years after, most notably my first table-driven program, a name generator creatively called NameGen, in BASIC, and the earliest version of TableMaster in Turbo Pascal. (one of the reasons I completely black-boxed TableMaster this time around, instead of just updating my old code, is that so much of said old code looked like someone trying to teach themself Turbo Pascal ... for good reason). The new TableMaster is Delphi, which is basically Pascal with a fancy front end and an overly high opinion of itself.

Also an overly high price tag. Delphi ain't cheap; I had to run a Kickstarter to be able to afford the version that would let me do cross-platform development (i.e., Mac). It's incredibly powerful, very easy to use (except when it isn't) ... and cost more than my car. (okay, I drive a cheap beater, but still) Even the "starter edition" of Delphi is a couple of hundred bucks. So, given that you're looking for something free, Delphi is definitely out.

There is, however, at least one free object Pascal implementation out there. I haven't looked into it much, because I've been a Delphi developer since the very first version. (when I sent in a picture of my old disc to prove my eligibility for the upgrade pricing, my sales rep almost fainted; she'd never seen the mythical Delphi 2, and I'd only used that because I couldn't find my Delphi 1 disc, 20 years and four moves later) It's something you might want to consider. I wish I could tell you more about it.

I wrote the first TableMaster in Turbo Pascal because it was what I had. However, I could have picked a lot of worse languages. It's also what a friend of mine -- a programmer at a defense contractor, by profession -- used to write a program he called "GemGen", which used the old AD&D gem tables to roll up hoards of gems. That sounds kind of limited, and it is, but he did that in 1989, when it was a much bigger deal. (when he and some of his friends were beta-testing the early TableMaster, I wrote him a table that duplicated what he'd done in GemGen) He had a fair number of choices available -- he had BASIC, Pascal, and C on that machine that I know of -- and his choice was Pascal. So check out that free version; you might like it, and Pascal is dead easy to learn.

If I was going to pick something both common and free, it would be Perl. I have a love-hate relationship with Perl. I don't actually know Perl; I just code in it anyway. I've been told I write FORTRAN programs in Perl. (of course, I've also been accused of writing FORTRAN programs in assembler, so this may just be a quirk) You can make Perl do pretty much anything you want to if you beat on it hard enough, there is excellent documentation (both free online and dead tree forms ... I'm old enough so I like the dead trees) available, and it's very good at smacking the data around until it confesses. There are several versions available for the PC (I have one attached to my favorite text editor, EditPlus, for handy local development) and just about everything and anything else programmable. It's a *nix native, so it's gotten into everything. I very much like Perl, except when I'm swearing at it.

PHP is another option, server willing. It has the advantage of being quite good at talking to databases. Depending on how you want to set things up, this might be quite useful.

Here's an example of a random generator I wrote in PHP some years back:
http://www.herofiles.org/utilities/namegen/names.php

The code is pretty simple and straightforward, though probably a bit too long to post here without breaking something in the forum. Drop me a message if you want me to zip it up and send it to you.

I'm just not a fan of JavaScript. It seems to me to be needlessly complicated in all the wrong ways, and not powerful enough where it needs to be. Maybe it's me, dunno. I know it's grown a lot since it and I first met, back in the late 90s, and I have occasionally done moderately complicated things with it, but I've never written a random generation program in it -- and I'm the developer of TableMaster, I'm that much of a table geek; I've written random generation programs in, let me think, FORTRAN, BASIC, Pascal, Delphi, Perl, PHP, and C++ (and of course TBL, TableMaster's own table building language). Oh, and Algol, let's not even go there. Just never JavaScript. So while I don't have a good, solid, sound reason for it, I'd still vote against it.

So, as a person who wrote a programming language (which, however, isn't free), my first choice for a free language you could write random generators in would be Perl, my second PHP, and my third that free Pascal.
 
I remember my Sinclair ZX-81 fondly. It smoke tested itself about 1986. I wrote a dice roller on it to; from 1 to 1000000 sides, with the ability to make adds to each die or the total roll, or both total roll and per die.

I still have my Amiga A3000 and AmigaBASIC runs on it. I rewrote the dice program and a time keeper, sun rise and set, moon rise and set, etc. for it as well.

Currently I have a Win 10 desktop. My university classes were in VAX Pascal, with two classes in Turbo C.
 
My university classes were pre-Pascal, so FORTRAN.

As an early hobbyist, I learned 6502 assembler on my original model Apple ][ with Integer Basic. Put a 6809 card in it and ported a Forth complier over. Still have it in the original box, serial number 660.

Worked as a programmer on flight simulators in PDP-11 and 6809 assembler, and real-time FORTRAN. Still have the assembly language pocket reference cards.
 
Somewhere packed away (either in a storage unit in another state, or my MIL's basement) I have an Amiga 500. I used to keep an Apple IIe (one I got very used around 1990) running to play Lords of Conquest on, too.

I tried to understand VAX assembler once. It didn't go well. :-/ It makes 68000 assembler, with its memory paging and all, look simple. Definitely, give me 6502! Actually, the only thing I ever wrote anything in assembler for was the Z-80, because with the 1k memory on the first ZX-81, you had to! (my first computer-related business was selling 2k memory upgrades mail-order)

I get a laugh any time someone claims I'm a [system] fan. Within arm's reach are Win7, Win10, OS X, iOS, and Android machines, and my (rented) webserver runs some flavor of *nix, I forget what these days; I've been through several. I snark all equally. I've been known to sit staring at a command prompt trying to remember what CLI I'm talking to. I think this started when I was in college, and using both TOPS-10 and VAX/VMS, and had to remember whether to put source or destination first to copy a file, and what the command to do it should be. (ah, PIP, I hate you still)

You know what's scary? I saw an ad for Visual Object COBOL. This implies that someone, somewhere, is writing new programs in COBOL, not just maintaining legacy stuff. And that there are COBOL programmers. COBOL programmers who want brand-new development environments. With COBOL.

Mind you, I can read COBOL; of course, anyone can. Some of the commands in TBL (TableMaster's scripting language) consciously mirror COBOL commands, especially the early arithmetic commands. Both TBL and COBOL were designed to make programming easy for non-programmers -- to the point that, 23 years ago when I wrote the first TableMaster manual, I avoided using any scary words like "program" at all -- so there are naturally a lot of similarities. But even though I've written a somewhat COBOL-like language, the whole concept of Visual Object COBOL comes across as just weird. What is anyone doing in COBOL that they can't do in something ... well, that isn't COBOL? Square peg, round hole, wham, wham, wham!

Ah, just thought of another language I crashed head-on into, though I never tried to write a random anything generator in it (possibly the only language this is true of): LISP. I think I did once write a LISP program that could output "Hello, World" but the mentality you have to have to be a LISP programmer and the mentality of a FORTRAN programmer (or procedural languages in general) are completely opposite. I'm just not one of the people who's smart enough to doublethink both at once. Or LISP at all.

You know what's depressing? Windows doesn't come with any flavor of programming language, and hasn't for years. That's just sad. If you're going to write something, you have to take the additional step of going off and looking for a suitable interpreter or compiler, possibly buying one, installing it, and so on ... not just popping up your BASIC interpreter and writing a bit of code to do whatever you need done. I write all my utility stuff (ex., something to convert old table files to account for the 21st century changes in TBL) in Delphi now, because it's what I have, but you have to be the kind of person who has a compiler already, not just any random computer user who wants something done. I think we've lost a lot there.
 
Back
Top