# Simulate LCD in terminal / command prompt

Page 1 of 1

## 1 Replies - 2285 Views - Last Post: 23 December 2007 - 08:02 PMRate Topic: //<![CDATA[ rating = new ipb.rating( 'topic_rate_', { url: 'https://www.dreamincode.net/forums/index.php?app=forums&module=ajax&section=topics&do=rateTopic&t=39989&amp;s=e95b796160de76b5f23f94255f33eb5a&md5check=' + ipb.vars['secure_hash'], cur_rating: 0, rated: 0, allow_rate: 0, multi_rate: 1, show_rate_text: true } ); //]]>

### #1 craig1709

Reputation: 0
• Posts: 20
• Joined: 14-June 07

# Simulate LCD in terminal / command prompt

Posted 23 December 2007 - 07:23 AM

This is really a general problem, although I will have to implement it in Pascal. We have to simulate a petrol pump, not too difficult, except for the LCD. If the price of the petrol is £1.24 it should display
```	 __
|	| |  |
|  __| |__|
|  |	  |
|  |__	|

```

Pardon the crappy ASCII art. The trouble is, what if it's £1.34? Then I have to replace the 2 with a 3 and this has to be done in the command prompt. The only thing I've thought of is having each line for each permutation but that's a stupid number of permutations. The course teacher is useless and doesn't know / won't help.

Any better ideas..?
-Craig1709

Edit: I now know the name of what I'm trying to emulate: a seven segment LCD display.

This post has been edited by craig1709: 23 December 2007 - 07:52 AM

Is This A Good Question/Topic? 0

## Replies To: Simulate LCD in terminal / command prompt

### #2 Nayana

• DIC Hawk - 나야나 नयन:

Reputation: 32
• Posts: 824
• Joined: 14-November 07

## Re: Simulate LCD in terminal / command prompt

Posted 23 December 2007 - 08:02 PM

Well for a start, your ASCII art doesn't emulate a 7 segment display. I.e. you only have 7 segments to work with which are
```._
|_|
|_|

```

And as for writing to a particular screen location, first use the command
GotoXY(x,y);

This post has been edited by Nayana: 23 December 2007 - 08:02 PM