Skip to content

cosmos-lang/Logic-Functional-Object-Oriented-Prototypal-Temporal-Tictactoe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tictacgame

Written in logic-functional object-oriented programming.

Why?!

It needs no further reason or explanation. This is,

  • A promotional piece for the Cosmos™ programming language and the Space™ graphical framework.
  • A groundbreaking experiment on multiparadigm programming.

This application marks an advance in multiparadigm programming language design and theory.

After all, it's probably the first time tictactoe (or for that matter any graphical application) has been made in at least three of the main four paradigms (and then a few others),

  • Logic programming.
  • Functional programming.
  • Object-oriented programming.
  • Procedural programming(?).

Ok, so we're not sure about procedural. Procedural is the one responsible for if-statements, and there are if-statements, so you could push it but that's just redundant. No one says "Procedural Object-Oriented programming". Let's forget about this one.

Open-source

Cosmos™, Space™ and this game is all open-source. Anyone can edit it but it's free of warranty.

Tic-tac-toe is probably on the public domain.

Installation

  • Install Cosmos 0.5+.
  • Install Space.
  • Place those files on the Space/ folder.

Type,

cosmos -l board
cosmos -l tictactoe

FAQ

How functional is this?

The approach we follow is described here, https://gamedev.stackexchange.com/questions/74015/pure-functional-programming-and-game-state

In summary, the game logic is entirely declarative, while only the draw function is impure and done with side effects. It may be possible to make drawing pure, but we didn't pursue the topic.

Why not reactive?

That is actually a great idea. If it were reactive too, then this would be a Reactive Logic-Functional Object-Oriented Prototypal Temporal version of tictactoe and the title would be even longer. Truly, we look forward to the day someone makes a reactive lib for the language and then we may do it. As things stand, we used the non-reactive method outlined above.

How logic is this?

It's all logic programming, in addition to functional features, thus logic-functional™. It's made in a logic language which uses another logic language as a host.

Honestly, we wanted to add some more support for constructive negation so we could brag about logic purity a bit further, but that'll have to wait for 0.6. It's also more verbose than it should be, really.

How OOP is this?

It follows the prototypal approach to OOP, except that the dictionary used for it is immutable so that it can still be logic-functional.

Incidentally, that's also how it's prototypal.

An OOP enthusiast may note that we could still make more things objects, although, it might become less procedural as a result.

Why not classical OOP?

Then it wouldn't be prototypal, making the title a bit shorter.

We couldn't have that.

How is this temporal?

next is an operator in temporal logic. This is something Cosmos™ incorporates by having a next keyword. Therefore, it is part of the temporal logic paradigm. Thus, it's not only logic-functional but temporal logic-functional.

That's just imperative programming!?

No, it isn't. Didn't you read above?

It can't be both OOP and functional!?

What an old-fashioned way of thinking.

I don't like OOP/logic/functional programming!?

That's your opinion.

About

An implementation of tictactoe in the Cosmos™ programming language.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published