Jump to content
Banner by ~ Ice Princess Silky

General Chat Thread


Apple      Bloom

Recommended Posts

No but seriously I'm very broke. My balance hit 0 awhile ago, so the bank charged me $4 for having zero. Then, when I couldn't get it back up in time, they charged me another $39. That means I now have to pay 40 dollars I don't have so I can have no money again. That's broke.

 

Link to comment
Share on other sites

2 hours ago, Olly said:

No but seriously I'm very broke. My balance hit 0 awhile ago, so the bank charged me $4 for having zero. Then, when I couldn't get it back up in time, they charged me another $39. That means I now have to pay 40 dollars I don't have so I can have no money again. That's broke.

 

Hope you can fix your financial troubles, but I am grossly inexperienced in that type of thing.

43 minutes ago, Ganaram Inukshuk said:

Sorry, I have to take care of myself before I dare take care of others, and that also includes financial anything and, hey, the site's unbroken.

Indeed, the site is unbroken.

And I thought it was an update at first.

A very poor one.

Link to comment
Share on other sites

(edited)
2 hours ago, Sir Punicpunch said:

I am grossly inexperienced in that type of thing.

Me too

Edited by Olly
Link to comment
Share on other sites

1 hour ago, Ganaram Inukshuk said:

@Sir Punicpunch quick question: can you understand these icons?

capture_icons_6.thumb.PNG.9122e2e2d41b81fcf69247492c6acb5e.PNG

Also, Rrr, why am I too stubborn to learn a different language, and no, I don't mean Spanish or whatever, I mean Kotlin or Java or C#.

More or less, yeah I can.

I tried learning a programming language. Got bored of it since I wouldn't know what to do with it.

Link to comment
Share on other sites

17 hours ago, Sir Punicpunch said:

More or less, yeah I can.

I tried learning a programming language. Got bored of it since I wouldn't know what to do with it.

that's still valuable knowledge. maybe you can teach us?

Link to comment
Share on other sites

If I tried teaching someone the basics of a programming language, I'd probably get something wrong. That said, I'm still learning and compare this...

import java.util.Random

class Street(var streetName: String = "unnamed street") {

    // Function generates a random street name, such as Kelly Road
    // or a tautological street name such as Street Street (1% chance)
    fun generateStreetName() {
        // Titles of a street
        val sT = listOf(
                "Avenue",	"Circle",	"Court",	"Crescent",
                "Drive",	"Lane",		"Road",		"Street",
                "Trail",	"Way"
        )

        // Names of a street
        val sN = listOf(
                "Apache",		"Belmont",		"Cannon",		"Dodge",
                "Elm",			"Forest",		"Garden",		"Hilton",
                "Imperial",		"Java",			"Kelly",		"Linden",
                "Mill",			"Noble",		"Orchard",		"Parker",
                "Queen",		"Rainier",		"Sunnyvale",	"Taft",
                "Underhill",	"Vista",		"Ward",			"Xenia",
                "Yucca",		"Zenith",

                "Araby",		"Bailey",		"Canton",		"Durham",
                "Evergreen",	"Fiesta",		"Grant",		"Hatch",
                "Ivy",			"Juniper",		"Kingston",		"Lindsay",
                "Melody",		"Newton",		"Olive",		"Poplar",
                "Quail",		"Robin",		"Sage",			"Twilight",
                "Union",		"Victor",		"Willow",		"Xavier",
                "Yuma",			"Zachary"
        )

        // Random number generator for determining whether a tautological name
        // gets generated; 1% chance by default
        val rng = Random().nextInt(100)
        if (rng < 99)
            streetName = "${sN.shuffled().first()} ${sT.shuffled().first()}"
        else
            streetName = "${sT.shuffled().first()} ${sT.shuffled().first()}"
    }
}

...to this (note: this is in two pieces):

#ifndef	OBJ_STREET_H
#define OBJ_STREET_H

#include <vector>
#include <string>
#include <fstream>

class ObjStreet
{
public:
	// Constructor: Create a new unnamed street
	ObjStreet();

	// Constructor: Create a new street with a preset name
	ObjStreet(const std::string&);

	// Copy constructor
	ObjStreet(ObjStreet&);

	// Destructor
	//~ObjStreet();

	// Member functions, no parameters
	std::string getStreetName();
	void generateStreetName(const bool);
	void renameStreet(const std::string&);

protected:
	// Protected values
	std::string streetName;

	// Protected member functions
	std::string makeStreetTitle();

	void makeStreetName();
	//void makeStreetNameCustom();
	void makeStreetNameTauto();

};

#endif
// ObjStreet .CPP File

// Street object implementation

#include "ObjStreet.h"

// ---------------------------------------------------
// ------------ PUBLIC MEMBER FUNCTIONS --------------
// ---------------------------------------------------

// Constructor: Create a new unnamed street
ObjStreet::ObjStreet()
{
	streetName = "unnamed";
}

// Constructor: Create a new street with a preset name
ObjStreet::ObjStreet(const std::string &name)
{
	streetName = name;
}

// Copy constructor
ObjStreet::ObjStreet(ObjStreet& s)
{
	streetName = s.streetName;
}

//// Destructor
//ObjStreet::~ObjStreet()
//{
//
//}

// Member function: Returns street name
std::string ObjStreet::getStreetName()
{ 
	return streetName;
}

// Member function: Generate a random street name
void ObjStreet::generateStreetName(const bool b)
{
	// DEBUG: Create a tautological name; chances are, it'll make "Street Street"
	if (b == true || b == false) makeStreetName();
}

// Member function: Generate a custom street name; uses names provided by a text file

// Member function: Rename a street
void ObjStreet::renameStreet(const std::string &newName)
{
	streetName = newName;
}

// ---------------------------------------------------
// ----------- PROTECTED MEMBER FUNCTIONS ------------
// ---------------------------------------------------

// Member function: Generate the title for a street name
std::string ObjStreet::makeStreetTitle()
{
	// List of possible names may be expanded on in the future,
	// but there aren't many possible titles to add in
	// There are currently 10 entries
	std::vector<std::string> t =
	{
		"Avenue",	"Circle",	"Court",	"Crescent",
		"Drive",	"Lane",		"Road",		"Street",
		"Trail",	"Way"
	};

	return t[rand() % t.size()];
}

// Member function: Generate the name of a street, including title
void ObjStreet::makeStreetName()
{
	std::vector<std::string> n =
	{
		"Apache",		"Belmont",		"Cannon",		"Dodge",
		"Elm",			"Forest",		"Garden",		"Hilton",
		"Imperial",		"Java",			"Kelly",		"Linden",
		"Mill",			"Noble",		"Orchard",		"Parker",
		"Queen",		"Rainier",		"Sunnyvale",	"Taft",
		"Underhill",	"Vista",		"Ward",			"Xenia",
		"Yucca",		"Zenith",

		"Araby",		"Bailey",		"Canton",		"Durham",
		"Evergreen",	"Fiesta",		"Grant",		"Hatch",
		"Ivy",			"Juniper",		"Kingston",		"Lindsay",
		"Melody",		"Newton",		"Olive",		"Poplar",
		"Quail",		"Robin",		"Sage",			"Twilight",
		"Union",		"Victor",		"Willow",		"Xavier",
		"Yuma",			"Zachary"
	};

	// This IF statement determines whether the street gets a normal name
	// or a tautological name; chance of a tautological name is 1 in 100 by default
	if (rand() % 100 < 99) streetName = n[rand() % n.size()] + " " + makeStreetTitle();
	else makeStreetNameTauto();
}

// Member function: Make a tautological street name
// Examples: Avenue Road, Street Avenue, Street Street, Lane Drive, etc
// This is just an easter egg; there is no other reason to have this function =P
// Maybe have it so that 1 out every 100 random name generations have this funny name
void ObjStreet::makeStreetNameTauto()
{
	streetName = makeStreetTitle() + " " + makeStreetTitle();
}

 

Link to comment
Share on other sites

20 minutes ago, Sir Punicpunch said:

How's it going everybody?

Don't have much to say, everything is pretty chill right now.

Not much... Just messing with Blender and watching let's plays of Roller Coaster Tycoon.

Link to comment
Share on other sites

On 4/12/2018 at 7:11 PM, Sir Punicpunch said:

How's it going everybody?

raw

13 hours ago, Matraxial Artemis said:

Hello Everypony!

 

hello newcomer and welcome 

  • Brohoof 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Join the herd!

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...