From fec7f5156e554550d2dca91a50921707fd5ba4d1 Mon Sep 17 00:00:00 2001 From: Elronnd Date: Sun, 15 Jan 2017 14:05:19 -0700 Subject: [PATCH] Start afresh. No reason to have old copies of bearlib terminal in history --- .gitignore | 8 ++++++++ LICENSE | 53 ++++++++++++++++++++++++----------------------------- dub.json | 12 ++++++++++++ src/app.d | 14 ++++++++++++++ src/main.d | 9 +++++++++ src/ncurses.d | 10 ++++++++++ 6 files changed, 77 insertions(+), 29 deletions(-) create mode 100644 .gitignore rewrite LICENSE (84%) create mode 100644 dub.json create mode 100644 src/app.d create mode 100644 src/main.d create mode 100644 src/ncurses.d diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4a58adc --- /dev/null +++ b/.gitignore @@ -0,0 +1,8 @@ +.dub +docs.json +__dummy.html +*.o +*.obj +__test__*__ +drl +*.swp diff --git a/LICENSE b/LICENSE dissimilarity index 84% index 8ebac10..c5613ee 100644 --- a/LICENSE +++ b/LICENSE @@ -1,29 +1,24 @@ -BSD 3-Clause License - -Copyright (c) 2016, -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -* Neither the name of the copyright holder nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +Copyright (c) 2017, Elijah Stone +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/dub.json b/dub.json new file mode 100644 index 0000000..2842abd --- /dev/null +++ b/dub.json @@ -0,0 +1,12 @@ +{ + "name": "drl", + "authors": [ + "Elronnd" + ], + "dependencies": { + "ncurses": "~master" + }, + "description": "A roguelike in D.", + "copyright": "Copyright © 2017, Elronnd", + "license": "BSD-3" +} diff --git a/src/app.d b/src/app.d new file mode 100644 index 0000000..9b592d9 --- /dev/null +++ b/src/app.d @@ -0,0 +1,14 @@ +import std.stdio; +static import ncurses; +import core.stdc.locale; // unicode... +import std.string: toStringz; + +void main() { + setlocale(LC_CTYPE, ""); + ncurses.initscr(); + ncurses.printw(toStringz("日本語からの「Hello World!")); + ncurses.refresh(); + ncurses.getch(); + ncurses.endwin(); + writeln("Edit source/app.d to start your project."); +} diff --git a/src/main.d b/src/main.d new file mode 100644 index 0000000..c5857c3 --- /dev/null +++ b/src/main.d @@ -0,0 +1,9 @@ +static import ncurses; + +void main() { + ncurses.initscr(); + ncurses.printw("Hello, world!"); + ncurses.refresh(); + ncurses.getch(); + ncurses.endwin(); +} diff --git a/src/ncurses.d b/src/ncurses.d new file mode 100644 index 0000000..379a640 --- /dev/null +++ b/src/ncurses.d @@ -0,0 +1,10 @@ +import deimos.ncurses; + +void printw(T...)(T args) { + import std.string: toStringz; + string tmp; + foreach (string i; args) + tmp ~= i; + + printw(toStringz(tmp)); +} -- 2.11.4.GIT