Posts

Showing posts from November, 2016

How to fix the Unbound module Graphics in an ocaml project

Image
From ~/pr/gitl/ocaml-gol In a constant effort to learn new programming languages, I'm currently trying to use ocaml , a free and open-source general-purpose, multi-paradigm programming language maintained at the Inria . It's basically an extension of Caml with object-oriented features. I'm mostly interested by its functionnal and pattern matching features but the module part of the language can be a bit difficult to understand for someone with little to none ML (Meta Language) background.   The error When trying to use the graphics module to create a graphical window and go just a little further than the simplest helloworld program, here is the result : If the project uses dune : (executable (name ocaml_project) (libraries lwt.unix graphics) ) with this code : let () = Printf.printf "Hello, world!\n";; Lwt_io.printf "Hello, world!\n";; Graphics.open_graph " 800x600";; The first times I built this project running the du

RainbruRPG switched to revision 254

Image
RainbruRPG v0.0.5-253 is over, a client-only work. Since the last release announcement , two revisions later, many client improvements have been implemented : We added a FPS-related statistics geometry buffer to the MainMenu ; The Alt+Enter key binding adds a real time full screen switch feature; You can take a .png screenshot using the F11 key. Original Nov. 2016 news All these improvements are possible thanks to the game state handling of the client. You can download this release at github . Next release will focus on new client improvements and a better Ogre3D reconfiguration mechanism. This will let us handle new keybindings for real time resolution change and maybe start to implement the Options game state. Sep. 2022 update As I already announced in others updated news about this project, it is not hosted at github anymore but in bitbucket instead. Here is its new homepage . As a direct result, all links from this news are now dead. I only keep it for his

List items conversion to string in python

Image
My last post about string handling was written in ruby. This time it's a one-liner I use for a private python-powered project. It is inspired by two StackOverflow answers :  how to convert all items in a list to floats and how to change any data type into a string in python . If you mix the two answers, the result code is [str(i) for i in <list name>] . Now let's see how to use in an interactive shell and in a PyQt4 example.

How RainbruRPG will handle game states

Image
This design-related post will try to explain how we're implementing RainbruRPG 's game states. As stated in the  last announcement , we now have to handle multiple states : main menu and local test . The game states will allow us to have multiple screens, one at a time.