Skip to content

Instantly share code, notes, and snippets.

View su8's full-sized avatar

su8

  • defunct
View GitHub Profile
char *idx = buf + strlen(var);
get/setAttribute
referemce_wrapper
text edit0r
hellxcb border rgb
extraction functions
peripherial functions
-static-libc++ compile flag
wget https://github.com/USER/REPOSITORY/pull/1.diff
memcpy snprintf allptr+=
https://codereview.stackexchange.com/questions/27986/text-based-rpg-game-using-classes
<!DOCTYPE html>
<html itemscope itemtype="https://schema.org/QAPage" class="html__responsive " lang="en">
<head>
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
sda 8:0 0 30G 0 disk
├─sda1 8:1 0 29G 0 part /
├─sda2 8:2 0 1K 0 part
└─sda5 8:5 0 975M 0 part [SWAP]
sr0 11:0 1 1024M 0 rom
@su8
su8 / c++b.cpp
Created March 18, 2025 12:56
blog
/*
12/20/2024 https://github.com/su8/c++blogfy2
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
#include <string>
#include "MobClass.h"
classMob::classMob(std::string name,int lvl,std::string area,int difficulty)
{
setName(name);
setLevel(lvl);
setArea(area);
setDifficulty(difficulty);
setDamage();
setMaxHealth();
#include <string>
class classMob
{
public:
classMob(std::string,int,std::string,int); // name,lvl,area,difficulty
void setName(std::string);
void setLevel(int);
void setArea(std::string);
void setDamage();
#include <string>
#include "Player.h"
player::player(std::string name,std::string area,int level = 1,int EXP = 0)
{
setName(name);
setArea(area);
setLevel(level);
setEXP(EXP);
setMaxHealth();
setHealth(playerMaxHealth);
#include <string>
class player
{
public:
player(std::string,std::string,int,int);
void setName(std::string);
void setArea(std::string);
void setLevel(int);
void setEXP(double);
void setHealth(double);
#include "MobClass.h"
#include "Player.h"
#include <iostream>
#include <cstdlib>
#include <ctime>
#include <windows.h>
using namespace std;
player battle(player account);
player calcEXP(player account,classMob monster);
#include <ncurses.h>
#include <string.h>
#include <ctype.h>
#include <stdlib.h>
struct input_line {
char *ln;
int length;
int capacity;
int cursor;