Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

3D-Rubik's cube simulator written in Haskell using Gloss

License

NotificationsYou must be signed in to change notification settings

MWRuszczycky/rubiks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Overview

This is a 3D-Rubik's cube simulator written entirely in Haskell usingGloss.

rubiks demo

Play

The play is pretty rudimentary (it's just a Rubik's cube), but it seems to work!

  • To quit the game, close the window or press Esc
  • To rotate a layer of the cube, left-click on a cell in the layer and drag it to an adjacent cell in the direction that you want to rotate (see the demo animation above).
  • To rotate the whole cube, left-click adjacent to the cube and drag up-down or left-right.
  • To scale the cube, right-click anywhere and drag up to reduce the size or down to increase the size.
  • To undo your last move, press the space bar.
  • To return the cube to the solved state, press 's'. This clears all previous moves.
  • To addn random moves to the current cube, pressn wheren is a digit between 0 and 9. Pressing 0 will add 10 random moves. So to add 15 random moves, press 0 then 5. Doing this will clear all previous moves, so you cannot undo it!
  • You can also play with a cube that is colored any way you like using the-c option and a path to a text file containing the six RGB hexcodes you want to use. For example, thedemos directory contains a pastel color scheme that you can apply by runningrubiks -c demos/pastels.txt.

To display help information (including the above command list), runrubiks --help at the terminal.

Installation and uninstallation

The game uses theHaskell Tool Stack, so to clone and compile the repository, try

git clone https://github.com/MWRuszczycky/rubiks.gitcd rubiksstack build

To run the game from within the repository after building, try

stackexec rubiks

Alternatively, you can locally install it using

stack install

from within the repository andStack will tell you where the binary has been placed. You should now be able to run the game from either the command line or the program menu.

To uninstall, delete the repository and the binary installed by stack if you did a local install. There are no other configuration files.

Known issues and to-do

  • The program should run on Windows and Linux. If you are using a tiling window manager (e.g.,i3), then you may need to toggle floating mode on the window. I do not have a Mac to testrubiks on; however, an issue has been raised that window resizing can cause warping of the cube when running in this system. Suggestions and pull requests are welcome.

About

3D-Rubik's cube simulator written in Haskell using Gloss

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp