Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I'm making a RPG game in batch, and the game looks bad, like the text layouts, does anyone have any design tips so my game looks more aesthetically pleasing?
I gave my students task to create I/O interactive, Terminal Based game, and some of students actually came back with fun results.
Use ASCII art. you can add different characters or scenes using ascii arts. you can find different arts on webpages like here and here. also you can convert your images to ASCII arts, that way you will be able to display any some images on Command Prompt
use ASCII Frames/borders for text and questions displays. you might need to resize frames by adding more characters, so it will fit your text.
use different colors to display different options, or underline good/bad events. I'm not sure about windows CMD but i tried on Unix and it works and looks pretty fun
Use Animations. Animate some lines by deleting line and redrawing/rewriting them. this way you will be able to receive Animation like results. its pretty easy, but you will need to store amount of characters outputted in line, so you will be able to clean exact amount of characters, otherwise you can clean full line
Here is example game that is fully created using ASCII art and it actually is pretty fun.
small examples from one of students i could find:
hope you'll find what you are looking for!
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 1 year ago.
Improve this question
I have a use case that I want to use to help independent creators talk about their interests on Twitter using their experiences.
It goes like this:
You have an interest you want to talk about Entrepreneurship
You have an experience like Pain
Is there a way for an AI (like GPT) to generate prompts that uses these two words to create a list of open-ended questions that provoke thoughts such as these:
If entrepreneurship wasn't painful, what would it look like?
What do you know about entrepreneurship that is painful that starters should know?
How can you lower the barrier to entrepreneurship so that it's a less painful opportunity for a person to take?
If so, how will it work, and what do I need to do?
I've explored Open AI's documentation on GPT-3, I'm unclear if it solves this problem of generating prompts.
Thanks!
You should provide some samples so that the GPT-3 can see the pattern and produce a sensible response from your prompt.
For example, see the following screenshot from your case. Note that the bold text is my prompt. The regular text is the response from GPT-3. In that example, I was "priming" the GPT-3 with relevant pattern: First line, the general description, then the Topics, followed by Questions. This should be enough for booting up your ideas and customizations.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 2 years ago.
Improve this question
I am writing a weather program that calls an API for data. One of the flags available is a preferred language, of which there are about 45 options. This leads me to the question.
What is the most efficient way to display all the language options, then allow user input, then check for valid input?
My best idea is a loop that prints all the options from a file. The user then inputs an option. Their selection is checked against the list to find a match. If there is a match then the program continues. If not, they are prompted again.
Is this the best way to go about this? I'm trying to make this program as efficient and professional looking as possible as I'm using it for my portfolio.
My best idea is a loop that prints all the options from a file. The user then inputs an option. Their selection is checked against the list to find a match. If there is a match then the program continues. If not, they are prompted again.
Is this the best way to go about this? I'm trying to make this program as efficient and professional looking as possible as I'm using it for my portfolio.
There are always multiple competing goals (single-thread performance, scalability, features, flexibility/extendibility, code readability, fault tolerance). For well designed code, its good to understand the importance of each of these goals for each piece of code (and good to understand that these importances can be different for different pieces of code in the same project). For this specific piece of code; I'd say that flexibility/extendibility (e.g. the ability to add new languages easily later) is the most important, followed by code readability (the ability to understand the code later, and find/fix bugs in it). The least important are scalability (e.g. how much performance increases when number of CPUs increases) then single-thread performance; because the code only needs to work once and is held back by the speed that a human can type anyway.
Is this the best way to go about this? I'm trying to make this program as efficient and professional looking as possible as I'm using it for my portfolio.
In terms of "human computer interaction"; the best way is to make it impossible for the user to enter invalid data (e.g. a drop down list with a well predicted default to avoid the need for a "not set yet" option). The second best way is "active status" - specifically, for every "user input event" (key press, mouse click, etc) a status field corresponding to the input field/control is updated to either indicate that the field/input is in an acceptable state, or provide the reason why it's not; where its impossible for the user to continue (e.g. because an "OK" button is disabled) until all of status fields are saying that the input is acceptable. For both of these options there is no need to validate the submitted input afterwards.
Sadly; for "command line", it's almost impossible to use the best way and almost impossible to use the 2nd best way.
In other words; you need to forget about performance/efficiency (because that's the least important); and then forget about writing software that is good/user-friendly (because it's command line).
The question then is; what is the "least bad" option? For this; I'd start by assuming that the data for each language is stored in a separate file (or directory?) where the file name is usable for display purposes; and all of the data is in a specific directory (e.g. a "project/lang" directory that contains a "project/lang/UK_English" file, a "project/lang/Spanish" file, etc). In this case you can get a list of files in the "project/lang" directory, sort them in alphabetical order, and use them to display a list of numbered options ("1) Spanish", "2) UK English", ..). Then if/when the user selects an option you can validate it (and report any errors if the user entered a bad character, a number that's too high, etc, then ask the user to retry); and load the right file for whichever language they chose (and report any errors if there's a problem with the file and ask the user to choose something else).
That way; people/translators can just create new files, and none of the code will need to be modified.
For a comparison; the fastest way is to use constant strings (e.g. puts("1) Spanish\n2) UK English\n\nEnter language choice:")); and to predict what the user will choose (e.g. based on keeping track of what they chose last time) and "pre-fetch and pre-parse" in the background (so that hopefully all the work is done for the correct choice before the user actually makes a choice), with the ability to quickly cancel the "pre-fetch and pre-parse" work if the user makes a choice that wasn't predicted. This would be extremely good for performance (likely "instant") but extremely bad (inflexible, over-complicated, too hard to maintain).
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 3 years ago.
Improve this question
So I'm currently learning OpenGL, and while working through some of the tutorials, I've noticed that most of them create multiple buffer-array-objects (BAO) for the vertex-positions, normal-vectors and uv-coordinates. But there is also the option to just create a single BAO, where each element includes all the necessary information about a single vector. So what's the "good" or rather "recommended" way of doing things? Create multiple ones or just a single one?
From Buffer Object - OpenGL Wiki (recommended reading):
Buffer Object Usage
Buffer objects are general purpose memory storage blocks allocated by OpenGL. They are intended to be used in a great many ways. To give the implementation great flexibility in exactly what a particular buffer object's data store will be, so as to better optimize performance, the user is required to give usage hints. These provide a general description as to how exactly the user will be using the buffer object.
BO's are shared between the client and the server (in OpenGL terms). How many of them you should use, is entirely up to you. Your instincts seem to be good however. You should never optimize before you just get it working. But after you've had some experience with OpenGL, you'll probably find there are use cases, where a little early optimization can save you a lot of refactoring later on.
I can't help you much with where to draw those lines, but I would say that you should think first, about what and when you intend to render as execution progresses.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I was making some games using Game Maker, but I would like to make simple games using C. I am a newb C programmer. When I code the output is always in the CMD Windows Console. I could make some simple games but always in the console, which is not very flexible (you can't animate without scrolling). When you run a more complex game, a complete new screen is created and I actually interact whit that screen.
So the question that i am having using C language is: How is this new screen being loaded? I think there is some windows API to create a new screen or something. By the way, in the old times, I mean DOS time, you just used a console but you could load a new screen where the game was played. How can you achieve this?
I would like some guideline to research the root. I just don't want to call library X or use SDL.
Thanks your your help.
Since you mention library X i assume you are on a Linux system. There are several different ways to archive your goal. If you would like to still use the console but with more graphics involved you could take a look at library ncurses ( http://www.gnu.org/software/ncurses/ ).
If you want to do more advanced graphics i recommend you to take a look here : How do you create a window in Linux with C++?
C programming dates back to 1970's, so you can think of creating games similar to that era.
The window or the new screen is loaded by few preprocessor directives which are already compiled and stored by the developers.
A new screen can be achieved by giving a few commands:
#include<stdio.h>
#include<conio.h>
void main()
{
local declarations;
And your program for the game;
getch();
}
What this basically do is the function getch(); which is stored in (conio.h) will open a new window and it will display
the output till it gets a value from the keyboard ie it displays the output till you press any key from the keyboard.
hope this answer helps you.
Creating new Windows can get pretty hairy (ie. the code can be complicated and difficult to read). I'll try to give a somewhat high-level overview, then link you to a good tutorial for loading a basic window.
You need to declare a couple of variables of types HWND and WNDCLASSEX, and call a bunch of Windows API functions to initialize the Window with some settings and whatnot.
Once this is done, you need to enter a loop that handles all the window interactions, usually with TranslateMessage and DispatchMessage inside the loop.
You also need to implement a callback procedure for handling Windows events such as mouse clicks, closing the window, etc. This is usually done in a LRESULT CALLBACK WndProcedure.
I've now thrown a bunch of new words and ideas around with little explanation; check out this tutorial for a full example of what I've just tried to explain.
http://www.functionx.com/win32/Lesson01c.htm
(EDIT: the link above is dead now, so here's a link to a cache of it from the Wayback Machine https://web.archive.org/web/20190203182520/http://www.functionx.com/win32/Lesson01c.htm)
Hope this helps!
Also - this is all assuming you're on Windows based on your comment about a Windows API (ie. windows.h). If you're on Linux, you'll need to use X.
I'm making a program, and I want to be able to store questions and answers in a text file. What I'm doing right now is separating the different question/answer combos by a new line, and separating the questions from the answers by having the questions first, then /// (triple slash) and then the answer. The problem with this is that the user can't enter a triple slash or slashes at the end of the question without messing the program up.
So what I'm looking for is some character that I can put in that can't be entered by the user in any way shape or form to separate the questions and answers. What I'm leaning towards right now is some unicode symbol like a smiley face, but anything that's more perfect would be appreciated.
As a side question, where should I store this document on Mac OS X? Should it be in application support, or part of the app bundle itself?
There are some well-documented pre-existing text formats you might want to consider. I would look into csv (comma-separated-value), tsv (tab-separated value), json and xml. Most likely xml and json are overkill for you, but they solve this problem nicely, and if you already have libraries for dealing with those in your code stack, you can get going more quickly by using those.
But for a DIY approach, I would recommend tsv. It's hard for users to enter the "TAB" ASCII 09 character in web forms, and you can usually convert to space without losing much information if they do. Then you just have to work out what your record-separator will be; probably on the Mac you will want to use CR (ascii 13), but NL (ascii 10) is a fine choice too.