Code Monkey home page Code Monkey logo

trigonometry's Introduction

Header

Hi there!

Typing SVG

๐Ÿ™ƒ About Me

I'm a passionate developer with a love for building innovative solutions. I specialize in:

  • ๐Ÿ’พ Full-stack development
  • ๐Ÿ’พ Web Development

๐Ÿ’ป Technologies & Tools

C++ C Java HTML5 CSS3 JavaScript Linux Git Bash

๐Ÿ“ˆ GitHub Stats

Your GitHub Stats Top Langs Top Repos

๐Ÿ† Achievements

Gihub Achivements roadmap.sh

๐ŸŒ Connect with Me

Portfolio Reddit Linktree Email

๐Ÿ“ฐ Latest Blog Posts

๐Ÿค“ Fun Facts

  • ๐Ÿ”ญ I love model rocketry, cosmology, astrophysics and observational astronomy... I love space!
  • ๐Ÿ–ฅ๏ธ I enjoy doing all sorts of stuff in computer... from CAD to coding to animation!
  • ๐Ÿ’ก I am also good at tinkering and electronics.
  • ๐ŸŒ I enjoy traveling and exploring new places.

Footer

trigonometry's People

Contributors

akshit-chilkoti avatar

Stargazers

 avatar

Watchers

 avatar

trigonometry's Issues

Suggestion for Nicer Text!

Hello there! I suggest you to have a look at the following program. Run it, read its code, and see how you could replicate the same, "nice, readable" stdout output!

Also, please do not use numbers to ask users for navigating menus! You might want to make use of actual words, and check if they are equal to a string without caring about the case. Put the entire query into a function so you can repeat it if the user enters something wrong. Also, do not perform checks on the input in the same function that also gives the user these options! Use another function for it. That way, you will be able to repeat certain tasks easily.

You might want to make functions to, say, print lists, simple lines, et cetera, then use those throughout the program along with separate functions to check the user's input. This will make things easier! Using function pointers here will give you extra convenience.

Feel free to ask me for example code doing this stuff!

#include <iostream>
#include <thread>
#include <chrono>

#pragma region // Header definitions!
#define ORIGINAL_WRITING_DELAY 50;

template <typename T>
void print(T);

void sleep(long);
void write(std::string);
#pragma endregion

namespace Speed {
	// This `static` limits these variables to this
	// "translation unit" (`.h` and `.cpp` combination.)

	/* static */ long LETTER, COMMA, FULLSTOP, EXCLAIM;

	void reset()
	{
		LETTER = ORIGINAL_WRITING_DELAY;
		COMMA = 4 * LETTER;
		FULLSTOP = 10 * LETTER;
		EXCLAIM = 6 * LETTER;
	}

	void setDelay(const long p_to)
	{
		LETTER = p_to;
		COMMA = p_to * 4.0f;
		FULLSTOP = p_to * 10.0f;
		EXCLAIM = p_to * 6.0f;
	}

}

int main(const int p_argCount, char const *p_arrArgValues[]) {
	Speed::reset();
	printf("Yo, I'm here simply waiting for you to press Enter.");
	std::cin.ignore();
	write("Hello, World!\a");
}

template <typename T>
void print(T p_toOutput) {
	std::cout << p_toOutput << '\n';
}

void sleep(const long p_time) {
	std::this_thread::sleep_for(std::chrono::milliseconds(p_time));
}

void write(const std::string p_str) {
	char c;
	const unsigned int length = p_str.length();
	for (unsigned int i = 0; i < length; i++) {
		using namespace std;

		c = p_str.at(i);
		cout << c;
		cout.flush();

		using namespace Speed;

		// Sleep for some time, based on the character encountered:
		switch (c) {
		case ',':
			sleep(COMMA);
			break;
		case '.':
			sleep(FULLSTOP);
			break;
		case '!':
			sleep(EXCLAIM);
			break;
		default:
			sleep(LETTER);
		}
	}

	std::cout << '\n';
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.