1

Hi I'm writing a report for a project. It's about a ship war game with an old school terminal interface and I'd like to write my grid like in my program to be able to copy-paste screens from my terminal. It looks like this :

    ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐  
    │ A │ B │ C │ D │ E │ F │ G │ H │ I │ J │  
┌───┼───┼───┼───┼───┼───┼───┼───┼───┼───╆━━━┪  
│ 0 │   │   │   │   │   │   │   │   │   ┃   ┃  
├───┼───┼───┼───┼───╆━━━╅───┼───┼───┼───╂───┨  
│ 1 │ ◯ │ ◯ │ ◯ │   ┃   ┃   │   │   │   ┃   ┃  
├───╆━━━┿━━━┿━━━╅───╂───╂───┼───┼───┼───╄━━━┩  
│ 2 ┃ ✖ │ ✖ │ ✖ ┃ ◯ ┃   ┃   │   │   │   │   │  
├───╄━━━┿━━━┿━━━╃───╂───╂───┼───┼───┼───┼───┤  
│ 3 │ ◯ │ ◯ │ ◯ │   ┃ ✖ ┃   │   │   │   │   │  
├───┼───┼───┼───┼───╂───╂───┼───╆━━━┿━━━┿━━━┪  
│ 4 │   │   │   │   ┃ ✖ ┃   │   ┃   │   │   ┃  
├───┼───┼───┼───┼───╂───╂───┼───╄━━━┿━━━┿━━━┩  
│ 5 │   │   │   │   ┃ ✖ ┃   │   │   │   │   │  
├───┼───┼───┼───┼───╄━━━╃───┼───┼───┼───┼───┤  
│ 6 │   │   │   │   │ ◯ │ ◯ │   │   │   │   │  
├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤  
│ 7 │   │   │   │   │   │   │ ◯ │   │   │   │  
├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤  
│ 8 │   │   │   │   │   │   │   │ ◯ │   │   │  
├───┼───┼───┼───┼───┼───╆━━━┿━━━┿━━━┿━━━╅───┤  
│ 9 │   │   │   │   │   ┃   │   │   │   ┃   │  
└───┴───┴───┴───┴───┴───┺━━━┷━━━┷━━━┷━━━┹───┘  
╔═══════════════════════════════════════════════════════════╗  
║ <HAL> Je tire sur la case E3 de la file d'attente         ║  
║ <HAL> E3 : Touché                                         ║  
║ <HAL> J'ajoute la case E2 à la file d'attente             ║  
║ <HAL> File d'attente : E2                                 ║  
╚═══════════════════════════════════════════════════════════╝  

It uses chars from the Box Drawing Family (U+2500) for the grid and U+2716 for the cross and U+25EF for the circles

I'm using texlive full on Xubuntu 14.04, and my editor is TexWriter (and I use Latex very often since I'm math teacher and write everything with Latex). I compile with pdflatex --shell-escape --enable-write18 -synctex=1 -interaction=nonstopmode %.tex

I obviously tried in my preambule \usepackage[utf8]{inputenc} and \usepackage[utf8x]{inputenc} but there is always an error (like ! Package ucs Error: Unknown Unicode character 9472 = U+2500) I tried to use a verbatim environment but it doesn't work either.

I heard about Xelatex but i'm using pdflatex and since I'm working with another teacher who is not very geek (I'm already happy he accepted to work with Latex) I prefer not changing this...

Macros wouldn't help me neither because I'll have so many grids to write, it's nearly impossible without copy-paste...

In the worst case I'll do screen shots but it's soooo sad... I really hope there is a (simple) solution...

I searched everywhere but couldn't find anything (nothing to write a grid in text mode)

Thanks in advance for your help, normally I always find a solution alone but here I'm completely stuck... (sorry for my english)

PS My project source code and the Latex report can be found here if you're interested : https://github.com/Abunux/pyBatNav

0 Answers0