Author Topic: New TinyCurses version. v0.9a!  (Read 11627 times)

Ex

  • IRC Communications Delegate
  • Rogueliker
  • ***
  • Posts: 313
  • Karma: +0/-0
    • View Profile
New TinyCurses version. v0.9a!
« on: May 01, 2009, 10:21:11 AM »
I just released a new version of TinyCurses. It fixes a lot of rather large bugs, and implements some functionality that should have been there to begin with. Among other things:

- Printw now accepts everything that stdio's printf does.
- getstr now works correctly.
- All functions return what they're listed to in the documentation (Mostly 0).
- All functions should accept any input without crashing.
- Still no transparency support yet :( Sorry. It's finals.

Still a lot to do. Currently, any function that accepts a color (like printwext) changes the color of all text placed after it until the user of the library calls "color". I thought this was a good idea at first, but now I find it really annoying. In the next version, the color of text placed with addch or printw will only change if you call "color". Aside from that, I should really get transparency up and running, but I've been lazy. And I've been working on finals.

Get it here:
http://code.google.com/p/tinycurses/

purpleflayer

  • Newcomer
  • Posts: 13
  • Karma: +0/-0
    • View Profile
    • Email
Re: New TinyCurses version. v0.9a!
« Reply #1 on: May 01, 2009, 11:32:44 AM »
It is interesting, I don't think I have before seen a library written all in a header file!  ;D  I was at first confused!

Here are some ideas, they are not big but might be "nice".
  • since functions are defined in the header.  guard the file by wrapping it in "#ifndef TINYCURSES \ #define TINYCURSES" ...rest of file... "#endif".  in case a user accidentally includes multiply, this will make it safe, and also gives them a define to test in the case that they are swapping several curseses in and out
  • try for booleans this: typedef enum{false, true} bool;  (it is basically the same but a little nicer)
  • good work on mouse, with automatic cell coordinates, but please look at the buttons somehow also ;)

Please keep up good work! :)

Krice

  • (Banned)
  • Rogueliker
  • ***
  • Posts: 2316
  • Karma: +0/-2
    • View Profile
    • Email
Re: New TinyCurses version. v0.9a!
« Reply #2 on: May 01, 2009, 01:58:38 PM »
It's really rare occasion to see that bad source code.

Ex

  • IRC Communications Delegate
  • Rogueliker
  • ***
  • Posts: 313
  • Karma: +0/-0
    • View Profile
Re: New TinyCurses version. v0.9a!
« Reply #3 on: May 01, 2009, 06:32:35 PM »
It's really rare occasion to see that bad source code.

It's fantastic source code, what are you talking about :> Definitely better than anything you've done.

It is interesting, I don't think I have before seen a library written all in a header file!  ;D  I was at first confused!

Here are some ideas, they are not big but might be "nice".
  • since functions are defined in the header.  guard the file by wrapping it in "#ifndef TINYCURSES \ #define TINYCURSES" ...rest of file... "#endif".  in case a user accidentally includes multiply, this will make it safe, and also gives them a define to test in the case that they are swapping several curseses in and out
  • try for booleans this: typedef enum{false, true} bool;  (it is basically the same but a little nicer)
  • good work on mouse, with automatic cell coordinates, but please look at the buttons somehow also ;)

Please keep up good work! :)


Definitely, I need to be using #ifndef and all that. I'm not sure why I hadn't included it sooner, just absent minded I guess. Button clicks on the mouse absolutely need a better system for detection, I need to work on that. Thanks for the encouragement! :D

Krice

  • (Banned)
  • Rogueliker
  • ***
  • Posts: 2316
  • Karma: +0/-2
    • View Profile
    • Email
Re: New TinyCurses version. v0.9a!
« Reply #4 on: May 01, 2009, 07:13:49 PM »
Definitely better than anything you've done.

The current version of Teemu has zero known bugs. The project has 60 source files.

Ex

  • IRC Communications Delegate
  • Rogueliker
  • ***
  • Posts: 313
  • Karma: +0/-0
    • View Profile
Re: New TinyCurses version. v0.9a!
« Reply #5 on: May 01, 2009, 09:46:05 PM »
Definitely better than anything you've done.

The current version of Teemu has zero known bugs. The project has 60 source files.

No known bugs does has nothing to do with good source. Also, 60 files in and of itself to me is bad coding. Good coding is all a matter of personal preference, anyway. As long as it works, it works. I like my code, you like yours, and there's nothing wrong with either opinion :)

Krice

  • (Banned)
  • Rogueliker
  • ***
  • Posts: 2316
  • Karma: +0/-2
    • View Profile
    • Email
Re: New TinyCurses version. v0.9a!
« Reply #6 on: May 02, 2009, 05:46:33 AM »
No known bugs does has nothing to do with good source.

You are too young and ignorant so that this discussion could continue.