Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

/prog/, I have a question

Name: Anonymous 2006-05-06 20:30

I'm writing a program which takes a string (which has invisible escape characters) and it takes those escape characters and based on which escape chars are compared to my string ptr (its being passed) it needs to color the char it corresponds to.

Like... [^ would be white. etc.

so [^lolol

Would print lolol in white.

Thanks :).

Name: Anonymous 2006-05-06 20:56

what.

Are you drawing to a terminal or what?

Name: Anonymous 2006-05-06 21:01

Not quite. But that's not related to the question atm.

Name: Anonymous 2006-05-06 21:03

Let me explain better:

string is "^1lo^2lol"

lets say ^1 was white, and blue was ^2

I need it to print so 'lo' was white and 'lol' was blue.

I just need to figure out how to color those chars seperately.

Name: Anonymous 2006-05-06 21:19

>>1
i've done this before.  except i used ` instead of [.

it was lots of fun.

still no clue what your question is though.  all i see is a bunch of declaratives, but not a single interrogative in the post.

Name: Anonymous 2006-05-06 21:28

Oh sorry.

Lets say white is.. float fColWhite[4] = { 1.0f, 1.0f, 1.0f, 1.0f };

([0] being R, [1] being G, [2] being B, [3] being A)

And ^1lolol needed to be printed with fColWhite. (fColWhite is the color that ^1 escape char is)

How would I do that?

Name: Anonymous 2006-05-06 22:02

crude, yet functional:
void formattyPrint.printString(string inString) {
  for (int i(0); i < inString.size(); ++i) {
    if (inString[i] == '^') {
      normalPrint.changeColour(inString[++i]);
    } else {
      normalPrint.printCharacter(inString[i]);
    }
  }
}

Name: Anonymous 2006-05-06 22:03 (sage)

>>7
functional, assuming one disregards the GLARINGLY PAINFUL ERROR, at least.

Name: Anonymous 2006-05-07 0:37

^^^^^^^^^^^^^^^^^^^

Name: Anonymous 2006-05-07 13:05 (sage)

ge?

Name: Anonymous 2006-05-07 16:58

but what is changeColour and what is it doing (obviously passing a string)

Name: Anonymous 2006-05-07 18:00

>>11
Ask >>1, he will surely elaborate on his specific environment.

Name: Anonymous 2006-05-07 18:38

>>11
changeColour is much the same as changeColor, except written in Canadian english.  As to what is it doing, it's changing the color that normalPrint normally prints in.

Name: Anonymous 2006-05-07 20:29

>>13

You're a witty troll aren't you?

Name: Anonymous 2006-05-08 3:17

>>13
s/Canadian english/English/

Name: Anonymous 2006-05-08 3:21

>>13
s/Canadian/Hey!/

Name: Anonymous 2006-05-08 14:04

>>1
Print... hmmm... how do I postscriped ?

Name: Anonymous 2006-05-08 16:11

>>17
Postscript is made of lose and fail.

Name: Anonymous 2006-05-12 14:06

Hi, I want my computer to wash my dishes if I type ], thanks.

Name: Anonymous 2006-05-17 15:32 (sage)

>>8

that it's written in java?

Name: Anonymous 2008-02-16 19:47

          ┌───────────────────────────────┐
          │            (or A B)           │
          │      ┌───┐                    │
input     │  ┌──►│ A │──────────────┐     │ output
stream of │  │   └───┘              ▼     │ stream of
frames    │  │     ▲            ┌───────┐ │ frames
──────────┼──●     │            │ merge ├─┼──────────►
          │  │     │            └───────┘ │
          │  │     │     ┌───┐      ▲     │
          │  └─────┼────►│ B │──────┘     │
          │        │     └───┘            │
          │        │       ▲              │
          │        │       │              │
          │        └───●───┘              │
          │            │                  │
          └────────────┼──────────────────┘  
                       │
                       │
                   data base

Name: Anonymous 2008-02-16 19:48

          ┌───────────────────────────────┐
          │            (or A B)           │
          │      ┌───┐                    │
input     │  ┌──►│ A │──────────────┐     │ output
stream of │  │   └───┘              ▼     │ stream of
frames    │  │     ▲            ┌───────┐ │ frames
──────────┼──●     │            │ merge ├─┼──────────►
          │  │     │            └───────┘ │
          │  │     │     ┌───┐      ▲     │
          │  └─────┼────►│ B │──────┘     │
          │        │     └───┘            │
          │        │       ▲              │
          │        │       │              │
          │        └───●───┘              │
          │            │                  │
          └────────────┼──────────────────┘  
                       │
                       │
                   data base

Figure 4.6:  The or combination of two queries is produced by operating on the stream of frames in parallel and merging the results.

Name: Anonymous 2010-06-07 6:37

Hi, I can spam /prog/ too, you faggot.

Also, smoke weed everyday.

Name: Anonymous 2011-02-03 5:09

Name: Sgt.Kabu㖄馝kiman╡� 2012-05-28 19:03

Bringing /prog/ back to its people
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy

Don't change these.
Name: Email:
Entire Thread Thread List