python – procedural generation for a text adventure game

I'm working on a text adventure game written in Python and I'm at the point where I need to implement procedural generation for the card. Points are generated as the user moves so that the entire map is not generated at once, but is generated when the user approaches. For example, the user starts at position (0, 0) and so the points created at the start of the game are the eight points / squares that surround (0, 0) and of course (0, 0) themselves.

I'm having trouble finding an easy way to decide whether a "spot" or square is a plain, forest, beach, sea, mountain, etc.

Any help would be appreciated. Thank you very much.

lexical analysis – A C ++ lexer for analyzing regex-like text

I'm creating a parser and I've just finished my Lexer. I wanted to ask if I should change, add or rethink anything in my code! (I don't think the grammar matters a lot since it's just a lexer)

lexical_analyzer.h

#pragma once

#include 
#include 
#include 

// kinds of lexemes (i.e. tokens)
namespace la_enum
{
    enum token
    {
        STRING              // anything that isn't something below
        , AND               // +
        , CHAR_REPEATED     // *
        , LEFT_PARENTHESIS  // (
        , RIGHT_PARENTHESIS // )
        , ANY_CHAR          // .
        , COUNTER           // {N}
        , IGNORE_CASE       // I
        , SINGLE_CAPTURE    // O{N}
    };
}

class lexical_analyzer
{
public:
    lexical_analyzer(std::string patternInput) :
        pattern(patternInput)
    {
        addLexemes();
    }

private:
    void addLexemes(); // adds lexemes and tokens from the pattern to the vectors

    bool isSingleSymbol(char); // checks if it is an operator with ONE symbol

    void addString(); // is used to store strings (operands)

    void addOperator(la_enum::token, std::string&, int, int); // is used to store operators

    std::string pattern; // input pattern
    std::string characterBuffer; // buffer for operators with more than one symbol

    // 'lexemes' and 'tokens' have synched indexes
    std::vector lexemes; // stores lexemes
    std::vector tokens; // stores tokens
};

lexical_analyzer.cpp

#include "lexical_analyzer.h"

// adds lexemes and tokens from the pattern to the vectors
void lexical_analyzer::addLexemes()
{
    for (int i = 0; i != pattern.size(); i++)
    {
        // adds lexems and tokens from the char buffer (strings)
        if (isSingleSymbol(pattern(i)))
            addString();

        switch (pattern(i))
        {
        case ('+') :
            addOperator(la_enum::AND, pattern, i, 1);
            break;
        case ('*') :
            addOperator(la_enum::CHAR_REPEATED, pattern, i, 1);
            break;
        case ('.') :
            addOperator(la_enum::ANY_CHAR, pattern, i, 1);
            break;
        case ('(') :
            addOperator(la_enum::LEFT_PARENTHESIS, pattern, i, 1);
            break;
        case (')') :
            addOperator(la_enum::RIGHT_PARENTHESIS, pattern, i, 1);
            break;
        default :
            if (pattern(i) == '{')
            {
                // checks if it's the right syntax '{N}'...
                if (isdigit(pattern(i + 1)) && pattern(i + 2) == '}')
                {
                    addString();
                    addOperator(la_enum::COUNTER, pattern, i, 3);
                    i += 2;
                }
                else
                {   // ...otherwise it counts as a string and is added to the buffer
                    characterBuffer.push_back(pattern(i));
                }
            }
            else if (pattern(i) == '\')
            {
                // checks if it's the right syntax 'I'...
                if (pattern(i + 1) == 'I')
                {
                    addString();
                    addOperator(la_enum::IGNORE_CASE, pattern, i, 2);
                    i++;
                }
                // checks if it's the right syntax 'O{N}'...
                else if (pattern(i + 1) == 'O' && pattern(i + 2) == '{' && isdigit(pattern(i + 3)) && pattern(i + 4) == '}')
                {
                    addString();
                    addOperator(la_enum::SINGLE_CAPTURE, pattern, i, 5);
                    i += 4;
                }
                else
                {   // ...otherwise it counts as a string and is added to the buffer
                    characterBuffer.push_back(pattern(i));
                }
            }
            else // If the symbol isn't one of those above
                // it counts as a string (operand) and is added to the buffer
            {
                characterBuffer.push_back(pattern(i));
            }
        }
    }
    // check one last time if the buffer has content which is then added to the vectors
    addString();
    // prints tokens and lexemes
    for (int i = 0; i != lexemes.size(); i++)
    {
        std::cout << "Token: "" << tokens(i) << "" Lexeme: "" << lexemes(i) << """ << std::endl;
    }
}

// checks if it is an operator with ONE symbol
bool lexical_analyzer::isSingleSymbol(char c)
{
    if (c == '+' || c == '*' || c == '(' || c == ')' || c == '.')
        return true;
    else
        return false;
}

// checks if the buffer has content
// which is then added as lexeme and token
void lexical_analyzer::addString()
{
    if (!characterBuffer.empty())
    {
        lexemes.push_back(characterBuffer);
        tokens.push_back(la_enum::STRING);
    }
}

// adds an operator as a lexeme in the 'lexeme' vector, and token in 'tokens' vector
void lexical_analyzer::addOperator(la_enum::token tok, std::string& str, int pos, int sz)
{
    lexemes.push_back(std::string(str, pos, sz));
    tokens.push_back(tok);
    characterBuffer.clear();
}

main.cpp

#include 

#include "lexical_analyzer.h"

int main()
{
    //std::string in;
    //std::getline(std::cin, in);
    //lexical_analyzer(std::move(in));

    lexical_analyzer("Hell. (MY)I n..e (is+was) Melwin.O{0}");

    return 0;
}

Output:

Token: "0" Lexeme: "Hell"
Token: "5" Lexeme: "."
Token: "0" Lexeme: " "
Token: "3" Lexeme: "("
Token: "0" Lexeme: "MY"
Token: "4" Lexeme: ")"
Token: "0" Lexeme: "I n"
Token: "5" Lexeme: "."
Token: "5" Lexeme: "."
Token: "0" Lexeme: "e "
Token: "3" Lexeme: "("
Token: "0" Lexeme: "is"
Token: "1" Lexeme: "+"
Token: "0" Lexeme: "was"
Token: "4" Lexeme: ")"
Token: "0" Lexeme: " Melwin"
Token: "5" Lexeme: "."
Token: "0" Lexeme: "O"
Token: "6" Lexeme: "{0}"

Forms – Empty / missing value in input fields – text field etc. (best practice)

I like your question because it shows How important UX is and how it creates added value for products, Another thing is that it justifies the emergence of a new generation of professionals who specialize in UX copywriting.

Creating good experiences requires deep understanding of the product, the technology that drives it and the user behavior, I think what you need to do is think How would the target audience of the application understand the information better?,

It's not a good practice, "?" because it really only makes sense to the people who created the app and know how it works (that's you :)). Unless the app ends up on the desk of a UX copywriter or a product person who then creates the copy for you, you should ask a user or a stakeholder how they would like to see this information in the app. You can also search for similar apps and see how they deal with the missing information.

What is certain is that you do not hide the fields or "Unknown" or "?" Remember that missing information is information.

html – How can I move the text with the slider?

I only have a slider echo with HTML and CSS, the images move correctly, but the respective text is not superimposed and without animation. On top of each "slide" there should be a picture of the associated text.

I know the problem is related to the above class and position: absolutely, but if not, I cannot give it a fixed position in relation to the "banerosoa" div. I'm trying to turn a simple highlight into a slider and it gets out of control. I ask for a benevolent soul.

The code is as follows: (I think I won't leave anything without the post)

the html has bootstrap and little else


And the rest of the CSS is this:

.encima{
    position: absolute;
    width: 75%;
    top: 40%;
    left: 40%;
    transform: translate(-50%, -50%);
    color:#fff !important;
}

.encima a{
    color:#fff;
}

.banerosoa{
    width:100%;
    height:650px;
    overflow: hidden;
    padding: 0px;
}

Text – Does adding the punctuation symbol in parentheses have an advantage when referring to punctuation?

Clarity, conciseness and avoidance of ambiguity in the documentation offer security and the consumers of the documentation. With the technical documentation the author should take care to avoid ambiguities.

I would go ahead and point to a slash (/) and other punctuation marks (e.g. period (.), Exclamation mark (!), etc.) with the sign between serious accents / backticks (`). Regardless of what the wiki has to say about serious accents (1), you will notice a revival of its use in modern communication and documentation systems, which is due to its inclusion in the markup language Markdown (e.g. at StackExchange, Slack and many others), although it is intended to contain and display code, it is also useful for highlighting characters or anything of interest that is referred to (2).

"And finally, from a UX perspective, would only the first occurrence of the punctuation symbol be used to limit repetition?"

Usually doing well may contain a glossary of terms for easy reference. Consider use cases for the document: is there a high likelihood of quick searches compared to full document reads? In this case, it would be helpful to provide inline disambiguation (i.e., to include a repeat).

Note: To include a backtick within backticks, use double backticks to put a space before and after the contained backtick.

(1) https://en.wikipedia.org/wiki/Grave_accent

(2) https://www.ionos.com/digitalguide/websites/web-development/markdown/

Javascript – How do I create an onClick text in one line in the grid view

I'm trying to set up a table that shows a list of taxes with the amount due, the payment due, and the days remaining. In addition, I would like to add an option in the last line that shows a popup (via modal) with payment options when clicked. The table should look like this:

How the table should look

After doing some research and testing, I got this code, but it doesn't seem to work properly because it doesn't show me anything when it loads in the web browser:

                                        
                                        

Here is the C # code:

protected void Page_Load(object sender, EventArgs e)
        {

            if (!IsPostBack)
            {
                DataTable dt = new DataTable();
                DataRow row = dt.NewRow();

                dt = new DataTable();
                dt.Columns.Add("TaxList", typeof(string));
                dt.Columns.Add("AmountDue", typeof(string));
                dt.Columns.Add("PaymentDue", typeof(string));
                dt.Columns.Add("RemainingDays", typeof(string));

                row = dt.NewRow();
                row("TaxList") = "Federal Taxes IRS";
                row("AmountDue") = "$1,086.00";
                row("LastName") = "01/15/2020";
                row("LastName") = "18 days";
                dt.Rows.Add(row);
                gvPayrollTaxLP.DataSource = dt;
                gvPayrollTaxLP.DataBind();
            }
        }