• 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)?

Vargas

SOC-14 1K
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).

Even something as simple as BASIC would be helpful.

Thanks in advance!
 
The .NET languages for one...

Mono and MonoDevelop for multi-platform support (giving you at least C#)
or
Visual Studio Express (C# / VB.NET) for Windows Desktop (and/or Web)

both are free.


I am using Visual Studio and C# for most of my development (Web, WinDekstop, Win8 App, WinPhone App, Android App, iOS App).
 
You have a web browser (or you wouldn't be posting here), so therefore you have the JavaScript programming language and HTML/CSS display engine sitting in front of you, so you're all set for building web apps.

I wrote some articles for Stellar Reaches on this topic. Links and code/examples here:

http://inexorabletash.github.io/model2/
 
Perl is free, and nearly as easy to start out with as BASIC, and has scads of online resources for learning. I learned it explicitly because I needed something to write Traveller scripts for (animal encounter tables, random worlds, and so on).

I am quite happy to answer any Perl questions in this forum, as well.

https://www.perl.org/get.html

I recommend the distribution called "Strawberry Perl" if you have Windows.

Perl has a lot under the hood, but it is dead easy to start out with:

Code:
# Generate UPP
$str = int(rand(6)+1) + int(rand(6)+1);   # int(rand(6)+1) simulates 1D
$dex = int(rand(6)+1) + int(rand(6)+1);
$end = int(rand(6)+1) + int(rand(6)+1);
$int = int(rand(6)+1) + int(rand(6)+1);
$edu = int(rand(6)+1) + int(rand(6)+1);
$soc = int(rand(6)+1) + int(rand(6)+1);

# Print UPP
print "Strength: $str\n";  # \n is a newline
print "Dexterity: $dex\n";
print "Endurance: $end\n";
print "Intelligence: $int\n";
print "Education: $edu\n";
print "Social standing: $soc\n";
That's it. It runs and prints out a random UPP.

How's that for an initial learning curve?
 
Python's free, robust, and has IDE's on a wide variety of platforms. And it's as simple as basic, and a bit more powerful in handling strings.
It's usually run-time tokenized, but can be compiled to tokenized as well.

Java's also free and not too hard. It's not as straightforward as Basic, but the robustness makes up for it. Further, it's readily cross compiled to tokenized code to run on most OS's.

And, of course, Inform. Optimized for interactive fiction, but it can be used to generate cross-platform text-interfaces for non-IF applications. It has implementations for all current major platforms, including Windows, MacOS (every edition), Blackberry, iOS, and Android.
 
I'm considering returning to Python; in the past, I used Python 2.7; I'm not sure if to return to it, or to the more modern Python 3.4...
 
First up, did you know that spreadsheets can do what you want? They are quicker and easier to learn than a programming language and you can swap them with other Traveller enthusiasts quite easily. Look up OpenOffice for a free, high end spreadsheet. You will find on this site numerous examples of ship builders, and world and character generators. A few years ago I built an unwieldy monster that spanned two spreadsheets and used it to recreate turn by turn an entire sector for T4's Pocket Empires.

All the programming languages you are likely to be interested in are free. The easiest to get into are probably what are known as scripting languages. They are considered higher level languages as they abstract stuff away in order to be both easier to learn and make you more productive. Many start-ups do product prototypes in scripting languages. perhaps porting their code to something else only if it proves successful.

The three most popular scripting languages are Python, PERL and Ruby. Ruby is the newest and claims to take the best of Python and PERL. I like it as IMO its pretty intuitive. I like PERL too and Python less so, however Python is important as it is a mainstay for professional web developers.

https://www.ruby-lang.org/en/

robject's kind offer of PERL help on this forum is worth seriously considering and could possibly trump most other considerations. All the popular languages have vibrant coder communities, but some respondents can be impatient with new programmers meaning sometimes they are not the place to go when you are not sure what your question should be. You will hit this a lot when you start, often what you need isn't the answer, but help with figuring out the right question.

Javascript is good, but you can go further with a scripting language, faster. Java (not related to Javascript) is a mainstream language used for commercial software (reliable, stable, lot of programmers available), its good and often taught at universities, in part because industry wants more Java programmers, in part because it easily demonstrates many important principles in programming languages. Neither of which are important considerations in your case. Avoid C and especially avoid C++. The first involves something called a pointer and something else called memory management, both combined can age you rapidly as a new programmer. C++ is famous for allowing you to do anything, but is complicated enough that it takes you a long time to become proficient at anything.

If you are thinking about creating a web site, the most direct route may be to learn html, css and javascript. Scripting languages all create web sites, but there is an implicite need to already understanding the basics of these.

I'll add links here for TutorialsPoint and w3Schools. Both are good starting points.

Another link of note is StackOverflow which is a fountain of knowledge regardless of which language you choose.

Start by using a text editor like Notepad. If you find yourself getting more into your programming, start looking at IDEs. Eclipse is a standard one, but it has another steep learning curve that is likely not worth it until you get comfortable with your chosen language.

Hmmm, I've gotten a bit carried away... Hope this helps.

And just for fun, 13 languages you do not want to learn.
 
First up, did you know that spreadsheets can do what you want? They are quicker and easier to learn than a programming language and you can swap them with other Traveller enthusiasts quite easily.

I did know that and have considered it since I already have Excel but wasn't sure I could do what I want which is animal generation (for other than Traveller) in large-ish batches that can be printed out easily. (I'd like to do a run of, say, 20 for print out as a PDF preferably (if I have to do an interim step to get to PDF that's ok)).

Although actually I'd take a spreadsheet that does it on a onesy basis too.
 
I haven't used excel for a long time, but here's a link to a tutorial on using its random number generator. You want something like

=roundup(6 * rand())

To generate a random number between 1 and 6.

To use it, set up your page to generate an animal with the generator and simply refresh the page (f5 I think). Every time you refresh, a new animal is created as the result of a new random number being generated and used in your calculation. To make 20 animals at once, get the calculation right for one, then copy and paste it on the same page twenty times.

You will need to save your animals to another sheet as you cannot "save" a random number generator. To do so, copy the animal(s) (ctrl & a followed by ctrl & c), move to a new page, right click on the top left cell and from the drop down select "paste special". Only select to paste text and numbers. Job done.

Hope this helps. Spreadsheets are fun, animals are only the start...
 
Randomizers are easy to implement, it's the lookup tables of mods and combining them that looks pretty intense in a spreadsheet.
 
Randomizers are easy to implement, it's the lookup tables of mods and combining them that looks pretty intense in a spreadsheet.

It is. I did a High Guard ship design spreadsheet and those table lookups made for some really long formulas. But it's doable.
 
I'm considering returning to Python; in the past, I used Python 2.7; I'm not sure if to return to it, or to the more modern Python 3.4...

2.7 is still widely used; it's the default for OSX and for a number of linux distros (tho which I cannot say specifically), and most 2.7 code runs fine under 3.x

Likewise, a number of libraries have no 3.x port yet.
 
Personally, I’d recommend Python. It’s a very approachable language that can get useful work done in just a few lines of code, but has plenty of power when you need it. It’s good for console utilities, system scripts, native and web applications. It’s already pretty much the standard language for scientists and is now firmly entrenched in Finance (my own industry) and is invading other industries at a rapid pace.

For versions, I’d recommend Python 2.7 for now and frankly for the foreseeable future. It’s a fantastic core language and is going from strength to strength. If you’re on Windows, the standard Python distribution is fine, along with the windows platform extension module although it’s hardly necessary. In fact that’s how I learned Python.

If you have an iPad, there’s an excellent very feature rich version of Python for it called Pythonista. It’s $7 and is well worth it. I’m using it to teach programming to my kids and is easily the best teaching environment for programming I’ve ever come across, and I’ve looked at plenty. It's a lot more than just a 'toy' programming environment, but has loads of top notch graphics and web libraries baked in.

Simon Hibbs
 
JAVA.

Currently the most common language in education and one of the most common in Web applications. Two very good IDE are free as well (Netbeans and Eclipse) and will take over a lot of the manual stuff. Just do NOT use any teaching book that starts with comparing Java and C++ oder Java and C/Pascal/Modula2. And USE the IDE. You will eventually need to learn the meaning off all the "boilerplate" code. But in the start, just accept it. Solid runtime for the Webapps (Tomcat, Jetty) are free as well. Runs on almost any OS, that might be interesting if you want to host the app with a provider, *Nix boxes are often cheaper than Windows.

C#/VB.NET are the other choice. Bound to the MS environment and the free IDE versions are less capabel than the JAVA ones since MS sells the "Full Monty". The C# language is actually a bit easier than Java, the surrounding environment is less developed.

Both can, in addition to Webstuff, do classic stand alone applications and mobile programming (Android and WinPhone respectively)
 
Both can, in addition to Webstuff, do classic stand alone applications and mobile programming (Android and WinPhone respectively)

There's java for WinPhone. It's aftermarket, but it's out there.

C# and VB# are very limited in terms of non-windows support. And microsoft wants it that way.
 
Back
Top