Giter Club home page Giter Club logo

cliptic's Introduction

cliptic: Crosswords in your Terminal

  • A command-line interface for downloading and playing cryptic crosswords from within the terminal.
  • Puzzles are sourced from the free crosswords uploaded daily to Lovatt's.
  • cliptic is written in Ruby using the ncurses library

New to 0.1.3

Bug Fixes

  • Fix the ssl certificate bug that prevents fetching puzzles
  • Fix the "out of range" bug when moving to an undefined index using g

Features

  • Add manual redraw feature to the main puzzle view. Called with ^L (useful for terminal resize)
  • Add exit controls to the resize interface (q or ^C)

Features

  • VIM-like keybindings
  • Puzzles scraped daily from Lovatt's. Puzzles are cached locally to prevent excessive requests
  • Progress can be saved to continue puzzles at a later time
  • Time taken to complete the puzzle is logged on completion of puzzle. High scores can be viewed within cliptic
  • Track progress for puzzles released in the last week
  • Puzzle history is tracked, making it easy to pick up recently played puzzles
  • Select puzzles to play by date manually (puzzles are available for up to 9 months from release)
  • Customisation of cliptic's appearance

Dependencies

System

  • Ruby
  • Ncurses
  • Curl

Gems

  • curb
  • curses
  • sqlite3

Installing

As a Gem

  • cliptic is available as a Ruby Gem. To install, simply run:
gem install cliptic

Manually

  • Or, to install manually:
git clone https://github.com/apexatoll/cliptic
cd cliptic
rake build install

Running

  • To run cliptic after installation, simply run the command cliptic from within the terminal
  • When the program is first run it will ask the user whether they want cliptic to generate a default config file. This is located in ~/.config/cliptic/cliptic.rc
  • If the screen is too small to display cliptic, please resize until the prompt disappears

Other Commands

  • There are other commands that can be run from the command line

Today

  • The command cliptic today will play today's puzzle
  • This command can be followed with a negative number to play a puzzle n days before today
  • For example cliptic today -2 will play the puzzle from the day before yesterday

Resetting Progress

  • The command cliptic reset will allow the user to reset progress in cliptic.
  • The command can be followed with either all, states, scores or recents
  • all resets all progress
  • states resets all game progress
  • scores resets high scores
  • recents resets puzzle history

Main Menu

  • On the main menu there are several options
    • Play today's puzzle
    • Show this week's progress
    • Select a date manually
    • Display recent puzzles
    • Show high scores
    • Exit cliptic

Menu Navigation

Command Action
j/DOWN, k/UP Move cursor
q Back/quit
ENTER Make selection

Solving Puzzles

  • By default, cliptic uses vim-like keybindings for navigation and text manipulation. There are plans to release more "accessible" keybindings in the future.
  • Text manipulation is modal akin to vim. Vim-users will be familiar with insert and normal modes
  • The currently focussed clue is displayed within the window at the bottom of the screen. If you are on a cell that is an intersection of two clues (ie an across and a down) you can swap between them using TAB

Game Modes

  • There are 2 game modes that can be played. These can be changed in the cliptic config file.
  1. Auto_mark = 1 (default)
    • Each clue is marked once every cell is filled
    • The clue will be highlighted green or red depending on whether the attempt is correct
  2. Auto_mark = 0
    • No clues are marked automatically, similar to a paper crossword
    • Clues can be checked manually using the ^G command

Global Commands

Command Action
^S Save current progress (note that progress is saved when exiting puzzles by default)
^R Reveals solution for focussed clue (note that this forfeits adding this puzzle to high scores)
^C Exit puzzle
^E Resets timer and progress for puzzle
^G Mark current progress (only relevant if auto_mark is set to 0)
^P Pause game
^L Redraws the screen (useful on resizing terminal window)

Navigation (Normal Mode)

  • There are several ways to navigate the cells of the cliptic grid in NORMAL MODE.
Command Action
h, j, k, l Move cursor left, up, down, right. Arrow keys can also be used
(n)w Move to (nth) next unsolved clue
(n)b Move to (nth) previous unsolved clue
e Move to end of clue
<clue number>g Move to clue by number
<cell number>G Move to cell by number (not 0 indexed
TAB Swap from across to down clue (or vice versa)

Entering Text (Insert Mode)

Command Action
a-z Enter character to cell
BACKSPACE Delete one character
ESC Exit insert mode. Enter normal mode

Normal Mode

Command Action
I Move to the start of the clue and enter insert mode
a Advance one cell and enter insert mode
c(obj) calls d(obj) then enters insert mode
d(obj) delete the object provided after d (may be w for word or l for character)
i Enter insert mode
r(char) Replaces the character under the cursor with char
x deletes the character under the cursor

Configuration

  • Cliptic settings can be added to the cliptic.rc file found at ~/.config/cliptic/cliptic.rc

Interface

  • Affect how cliptic functions
  • Set using the format
set <setting> <0/1>

Settable Items

Item Description Default
auto_advance Move to next clue after solve 1
auto_mark Mark clues as they are entered 1
auto_save Save progress on exit 1

Colours

  • Colours are numbered 1-16.
    • 0 is default terminal color
    • 1-8 equates to your terminals 8 default colours.
    • 9-16 equate to same colours as the background and blank as the foreground
  • To set colour settings use the format
hi <obj> <colour>

Settable Items

Item Description Default
active_num Grid number of active clue 3
bar Top and bottom bars 16
block Grid blocks 8
box Box outlines 8
grid cliptic grids 8
incorrect Incorrect clue attempt 1
correct Correct clue attempt 2
prompt Menu prompt 3
default Default text color 0
meta Clue box metadata 3
num Inactive grid numbers 8
logo_text Logo text color 3
I Insert mode prompt 15
N Normal mode prompt 12
menu_active Active menu option 15
menu_inactive Inactive menu option 0

Feedback

  • Cliptic is still in development
  • If you have any feature requests or find any bugs please leave a new issue
  • Contributions welcome!

Dedicated to WES who passed on to me his love of crosswords

cliptic's People

Contributors

apexatoll avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

cliptic's Issues

Ruby Error when installing from Gem

I don't really know ruby so I'm not too sure of what's going on. I get an error when installing from Gem.

RDoc::Parser::Ruby failure around line 31 of
lib/cliptic/terminal.rb

          Game.new(date:Date.today+offset).play

Before reporting this, could you check that the file you're documenting
has proper syntax:

  /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby -c lib/cliptic/terminal.rb

RDoc is not a full Ruby parser and will fail when fed invalid ruby programs.

The internal error was:

        (RDoc::Error) Invalid class or module definition: Cliptic::Main::Player

ERROR:  While executing gem ... (RDoc::Error)
    Invalid class or module definition: Cliptic::Main::Player

Thanks, Aura

already closed window

When installing via gem install cliptic resulting in the output

Fetching cliptic-0.1.0.gem
Fetching sqlite3-1.4.2.gem
Fetching curses-1.4.2.gem
Fetching curb-0.9.11.gem
WARNING:  You don't have /home/<user>/.local/share/gem/ruby/3.0.0/bin in your PATH,
          gem executables will not run.
Building native extensions. This could take a while...
Successfully installed sqlite3-1.4.2
Building native extensions. This could take a while...
Successfully installed curses-1.4.2
Building native extensions. This could take a while...
Successfully installed curb-0.9.11
Successfully installed cliptic-0.1.0
4 gems installed

every time I try to run it I only get the result already closed window?

I've run it both directly from the ~/.local/share/gem/ruby/3.0.0/bin directory and also via a symlink to a directory in my path.

I'm on Arch Linux with gem version 3.2.21.

Thoughts?

Feature Request: third option in "Puzzle Complete" for 'view'

Sometimes, it's nice to look back and go over the parsing you did. In the current implementation, your choices are Exit and Quit. I propose a useful feature might be "view," where I could then navigate through the puzzle and double check the clue, answer and see that I parsed it correctly. Thanks!

undefined method `[]' for nil:NilClass

When I try to run cliptic (installed using gem install...) I get this error: "undefined method `[]' for nil:NilClass"

I'm using ruby 2.7.2p137 on Ubuntu 21.04. Let me know if you need other details.

Support exporting puzzle?

Thanks for this tool. I don't understand how Ruby works any more. I used to just run ruby and it worked, now There seem to be so many steps and versions, I can't do anything in Ruby.

Anyway, I was wondering if this tool could support exporting the puzzles in a format compatible with other crossword tools as well?Like PUZ or PUZ(txt) or XD or JPZ? It would be neat if there was a list in the terminal of the puzzles you had cached in the database, and then you could export them in a common format.

Quit/hangup keys blocked on "screen too small" warning

It's not possible to quit the program using q, ^C, or ^D when being served the "screen too small" warning, and must be forcibly terminated. The program expects to receive a quit signal only in "normal" mode. This means you can become softlocked if you open it in an environment where your combination of display settings doesn't support the expected display size. (See #4)

Allow redrawing screen

If starting the program in a window large enough to draw the interface, but then resizing (or navigating away from the program using a tiled window/fullscreen toggle, such that the geometry changes to be smaller than cliptic's desired geometry) and returning again, the ncurses output becomes garbled during the temporary geometry change and is unable to update again. Would it be possible to allow the user to manually redraw the window via a keybinding?

This is readily apparent on a tiling window manager due to the way the windows are resized on the fly.
Note: this will not occur if you resize to a larger geometry, but once you resize to a smaller geometry such that the lines wrap, it will be permanently distorted.

Terminal emulator: urxvt
Window manager: i3

Not letting me select puzzle from 2020-10-13

Supposedly, this is the earliest available puzzle, but when I try to select it, I get an exit code 1 with the following message:

Invalid date passed 2020-10-13
Earliest date 2020-10-13
Thanks for playing!

Looks like a little bug... Otherwise, working great!

EDIT: Thought I'd mention that 2020-10-14 and beyond are just fine.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.