• Stars
    star
    605
  • Rank 71,772 (Top 2 %)
  • Language
    Clojure
  • Created over 5 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Space War starting in Episode 55 of cleancoders.com

Space War

A Star Trek Game.

Courtesy of Mike Fikes (@mfikes) you can play a (possibly older) version at http://spacewar.fikesfarm.com/spacewar.html

The Borg have been defeated; but the federation fleet has been destroyed. The enterprise is the only star ship left in service. A few bases remain, but the Borg completely disrupted the antimatter and dilithium transport network.

The Klingons in Federation space took a beating as well. But the Borg didn't like the taste of Klingons in the "collective", so they simply left many crippled Klingon ships stranded in Federation space rather than assimilating them.

There are rumors that the Klingon fleet escaped total destruction and that the remaining ships are regrouping in Klingon space in order to form an invasion fleet. If so, it won't be long until they arrive in force.

Your Mission

Build the Corbomite device and use it to thwart the Klingon invasion!

All Federation shipyards were obliterated by the Borg. No new ships can be ready in time.

You will have to reconstitute a network of bases that you can use to supply yourself with antimatter, dilithium, and weapons. Harvest what you can from the crippled Klingons. Then build The Corbomite Device before the invasion fleet arrives in force.

Once you have enough production going, find The Pulsar and build the Corbomite factory there. Surround that factory with plenty of Antimatter and Dilithium bases so that it can manufacture enough Corbomite.

Once the Corbomite factory has been filled to capacity, it will transform into The Corbomite Device. When you dock with The Corbomite Device your ship will become much more powerful, and you should be able to rid the federation of all klingons.

Sensors

You have three views.

  • Front view, which shows you a pretty picture of stars, but is otherwise useless.

  • STRAT. is the strategic view of the whole galaxy. You can zoom in and out using the slider. You cannot see any weapons, explosions, or debris in this view; but you can see Klingons, Romulans, stars, bases, transports, and transport routes.

  • TACT. This is the tactical view. You can see what is nearby, including all weapons that you or your enemies have fired. You'll also see explosions.

Engines

You have two modes of movement. Warp, and Impulse.

  • The WARP engines move you in a sequence of leaps. Each leap is the same size. The more power you use the faster those leaps are made. Be careful, the energy consumed is not linear. Warp 10 uses a lot more antimatter than Warp 1. And, remember, rapid energy consumption increases the Core Temperature; especially if you are low on Dilithium.

  • The Impulse engines are reaction thrust engines. They consume antimatter and can propel you at speeds that are a significant fraction of C. At those speeds space itself has a viscosity. The ship feels a drag that limits the velocity, and will rapidly slow the ship when the engines are turned off.

  • The Heading control turns the ship. Both the Impulse and Warp engines move the ship in the direction it is facing.

Weapons

You have three weapons. Phasers, Torpedos, and Kinetics.

  • Phasers are powerful rays that move quickly and do a lot of damage. However, they are short range and lose effectiveness rapidly with distance. If you want to use them, get close. They are great in a stern chase, or a game of chicken.

  • Torpedos are slow, but pack a significant punch.

  • Kinetics are just cannon balls moving at relativistic velocity. They do a small amount of damage but are cheap to shoot.

You can fire all of these weapons in a spread if you like. Choose the number of shots and the spread angle with the sliders. Aim by clicking on the screen where you want the center of your spread to hit, and remember to lead your target.

Be careful, you can use your torpedoes up fast; and shooting phasers really heats up the core.

All weapons consume antimatter.

Weapons are not very accurate when fired from within a warp field.

Status

There are four things you need to watch at all times.

  • Antimatter is your fuel. If you run out, you'll be stranded. Don't run out.

  • Dilithium is the catalyst for the antimatter reaction. It gets gradually consumed by all operations. When you start running low you'll notice your core temperature increasing. This is because the antimatter reaction becomes less efficient.

  • Core Temperature needs to stay out of the red. Get too hot and you blow.

  • Shields. Shields absorb the energy of hits against you. They automatically replenish by consuming antimatter. You will start to experience real damage if the shields get below 50%.

Damage

There are six damage indicators. LIF, HUL, SEN, WPN, WRP, IMP. These indicators have four states. Green, Yellow, Red, and Black. As you might imagine, black is bad. It means the system is entirely non-functional.

  • LIF - Life support systems. The more damaged this system is, the slower repair operations are performed. If it goes black, you die. Don't let it go black.

  • HUL - This is the hull. It is the first thing repaired after LIF. If the HUL goes black, you die. Don't let it go black.

  • SEN - These are the sensors. As they degrade, you'll know it. If it goes black, you'll be blind.

  • WPN - These are your weapons. As they degrade the weapons will misfire and misbehave. Be careful!

  • IMP - Your impulse engines. As they degrade, you'll note a pronounced tendency for the ship to stall.

  • WRP - Your warp engines. As they degrade you'll notice the warp leaps become erratic.

As long as either LIF or HUL are not black, these systems will be gradually repaired. So it is often a good idea to warp away from a bad situation and wait the repairs out.

Docking

To replenish your antimatter, and weapons, you'll need to dock at a base. You do this by warping close and then using your impulse engines to approach the base as closely as you can. Put the ship on top of the base. Watch for the DOCK button to show up in the Engine Control Panel. Hit that button to be refueled and restocked.

Bases

There are four kinds of bases. Antimatter factories, Dilithium factories, Weapon factories, and The Corbomite Factory.

  • Antimatter factories manufacture antimatter using the power from nearby O, B, or A class stars (the big blue or white ones).
  • Dilithium factories harvest dilithium from the atmospheres of nearby K or M class stars. (the little red or orange ones.)
  • Weapon factories manufacture Kinetics and Torpedos. They require the elements found around the planets of F or G class stars (The medium sized yellow stars like our Sun).
  • Corbomite factories manufacture Corbomite. Only one can be built, and it must be built adjacent to The Pulsar. When supplied with a ready stream of antimatter and dilithium it will manufacture Corbomite.

You can deploy a base by gradually approaching the appropriate kind of star. When you are in deployment range, the appropriate deploy button will appear in the Deploy panel.

Deploying a base uses up a lot of antimatter and dilithium; so be careful.

Bases do not start making products right away, there is a startup time. During that time you will see the base partially obscured. Afterwards the bases start slowly manufacturing products.

Transport routes

On the strategic display you will find green lines that connect some of the bases. Cargo transport vessels follow these routes to supply the bases with the resources they need. Yellow transports carry dilithium. Orange transports carry antimatter. They travel at just over Warp 1.

Factories prefer to transport goods along short routes. Be careful how you lay them out. It is possible to deprive bases of resources by connecting them by long routes to bases that have short routes to other bases.

Transport routes have a maximum length. Bases that are too far apart will not ship goods to each other.

Production

Weapon bases use antimatter to create kinetics. This production is quite rapid. Torpedoes require substantial amounts of both antimatter and dilithium to create. Make sure you have the weapon factories connected, either directly, or indirectly, to antimatter and dilithium factories. Take care, a weapon factory can consume large amounts of dilithium.

Dilithium factories require small amounts of antimatter to produce dilithium. Dilithium production is slow, so you will likely need many of these factories.

Klingons

Some of the crippled Klingons are still pretty strong. Be careful. Others are so weakened that they'll run from you and won't put up much of a fight. They can detect you at long range. So expect visits from the stronger Klingons.

Klingons are slow because they never learned dilithium catalysis. Any dilithium they have on board was probably stolen and is strictly used for trading purposes.

Klingons can collect antimatter from all stars, though they collect faster from O and A stars, and only very slowly from K and M stars. You will often see them hovering around a star to refuel. Klingons are also more than willing to steal antimatter from a base.

Klingons have the facilities on board to construct torpedos and kinetics. This takes lots of antimatter. A Klingon hovering by a base or a star may be building up their arsenal.

Blockades

Klingons will sometimes invade your bases and take them over. Blockaded bases will not ship any materials to other bases. Materials manufactured by, or shipped to a blockaded base will be acquired by the occupying Klingons.

Beware, more than one Klingon can occupy a base. If you challenge a base with three or four Klingons occupying it; be prepared for a pitched battle. They often fly in formation, so it can be hard to know how many are flying together.

Klingon Battle Strategy

Once your ship is in range of a Klingon's short range detectors, the Klingon will head towards you to do battle.
The Klingon strategy is to confuse and delude you. They accomplish this by continuously changing tactics. Stay alert to their movements in the heat of battle; and don't let them get too close. At short range their phasers are devastating.

When a Klingon is critically low on resources, there is a good chance it will run away. This is a good time to attack them. Be careful though, the retreat may be a ruse.

Dilithium Clouds

When you destroy a Klingon vessel, their stolen on-board dilithium will disperse amidst the cloud of debris. You can harvest this dilithium by easing yourself as close as possible into the center of the cloud. Dilithium, when exposed to the vacuum, has a half-life of about a minute. So hurry.

Romulans

Romulans are marauders. Their ships are cloaked and quite difficult to detect. They are quite deadly, due to an omni-directional energy weapon that does tremendous damage and moves at roughly Warp 5. Fortunately they cannot remain cloaked while energizing or firing their weapon. During that very brief period they are quite vulnerable. A single shot will kill them.

A hit at short range from their weapon will completely drain your shields, do significant damage to your systems, and has a one in three chance of killing you outright. When they appear, you have two options: Fight, or run. If you choose to fight, make sure you hit them before they fire their weapon. If you choose to run, run fast and far; the weapon loses potency with distance.

The Pulsar

There is only one Pulsar in federation space. It is small and hard to find. It has a greenish tinge and flashes dimly. This is the only star that can support a Corbomite factory.

Saving and Pausing

The game is saved every five seconds. You pause the game by quitting. Your previous game will resume when you start the program up again. If you die, you will be resurrected in a random location with partial resources. If you want to start a new game, use the New Game button at the top left or delete the spacewar.world file before starting the game.

On the desktop, the game is saved in a file named: spacewar.world. You can rename this file if you want to set the current game aside and start a new one. You bring a set-aside game back by renaming it to spacewar.world.

More Repositories

1

fitnesse

FitNesse -- The Acceptance Test Wiki
Java
1,991
star
2

more-speech

A Nostr browser in Clojure.
Clojure
283
star
3

PPP

Excercises for Principles, Patterns, and Practices, iHop, Pood.
Java
158
star
4

CC_SMC

State Machine Compiler for Clean Code video series.
Java
119
star
5

PDP8EmulatorIpad

PDP8 Emulator for the iPad
Lua
112
star
6

videostore

The videostore example from Martin Fowler's Refactoring, and from Episode 3 of cleancoders.com
Java
84
star
7

WTFisaMonad

Talk: WTF is a Monad
Clojure
79
star
8

MACS_GOMOKU

Mobile Application Case Study -- GOMOKU project
Swift
79
star
9

clojureOrbit

Orbital simulator in Clojure
Clojure
77
star
10

AdventOfCode2022

Advent of Code 2022
Clojure
73
star
11

ubc-website

Website for Uncle Bob Consulting. Example for cleancoders.com functional programming series.
Clojure
70
star
12

rubyslim

Slim port for Ruby
Ruby
61
star
13

Episode-10-ExpenseReport

The Expense Report example from cleancoders.com episode 10
Java
58
star
14

javaargs

The Java version of the Args Program.
Java
53
star
15

FunctionalDesign

The source code for the examples in Functional Design
Clojure
53
star
16

unclebob.github.io

Uncle Bob's blog
HTML
47
star
17

AdventOfCode2021

Clojure
47
star
18

Clean-Code-Performance

C++
44
star
19

HTWCleanCoders

Hunt the Wumpus for Clean Coders Acceptance Testing Episodes.
Java
33
star
20

Euler

Clojure
33
star
21

sudoku

Sudoku solver for E61 of Clean Code (cleancoders.com)
Clojure
27
star
22

BinarySearch

Binary Search using TDD
Java
24
star
23

AdventOfCode2020

Clojure
20
star
24

mastermindclj

Master Mind in Clojure for Clean Code Functional series.
Clojure
20
star
25

functor

experimental macro for allowing Algol-like block structure scoping in clojure
Clojure
19
star
26

HTW

Hunt The Wumpus
JavaScript
19
star
27

springslim

A Java Slim Service that manages Spring Transactions.
Java
18
star
28

rubyargs

The ruby version of the Args program that I initially wrote in Java.
Ruby
17
star
29

smcjava

State Machine Compiler
16
star
30

wator

Clojure
16
star
31

environmentcontroller

TDD Exercise
Java
14
star
32

AOC23

Clojure
13
star
33

nslim

.NET port of SLIM.
C#
13
star
34

Empire

Based on old VMS empire game
Java
13
star
35

BIP340-elliptic-curve-signatures

Explore signing documents using BIP340 Schnorr Signatures. A la https://bips.xyz/340
Clojure
13
star
36

MazeSolver

Solve a maze from an image file.
Clojure
11
star
37

RndSelect

The project in response to @ploeh's blog about types and tests.
11
star
38

tddrefcpp

Exercises and Examples for TDD/REF in C++
C++
10
star
39

fSharpCaseStudy

F#
10
star
40

bugs

A simple game of chasing bugs
Clojure
9
star
41

covid_analysis

Clojure
9
star
42

gravity

A simple gravity simulator
Clojure
9
star
43

empty

OM Empty Repository
9
star
44

fitnesseextras

Some utilities for FitNesse.
Java
9
star
45

javasquint

A simple iterator based lazy evaluation program.
Java
8
star
46

perforcecmsystem

Plugin for marrying FitNesse and PerForce by Markus Gartner
Java
8
star
47

fitnessedotorg

FitNesse website fitnesse.org
JavaScript
8
star
48

CleanIOT

Python
7
star
49

turtle-graphics

A simple graphics tool based loosely on Logo turtle graphics.
Clojure
7
star
50

Welc

The code for the WELC course
Java
7
star
51

ScriptSchedule

Converts FinalDraft script to a shooting schedule suitable for Numbers or Excel.
Clojure
6
star
52

Mage-of-Lief

Partially completed scupture.
Ruby
6
star
53

RubyLibraryIHop

project for IHOP course in Ruby
Ruby
4
star
54

clojars-unclebobmartin

clojars group verification
2
star