Noob learns to code in 3 months

The Partridge Family were neither partridges nor a family. Discuss.
User avatar
Battlefrog
Posts: 69
Joined: March 31st, 2015, 10:10 pm
Location: Florida, United States of America

Re: Noob learns to code in 3 months

Post by Battlefrog » June 22nd, 2017, 4:37 pm

Volifed sure looks cool for the series.

Also Yumtard, do you mind if I snag the bitmap drawing code from your project? :)
Broc W.

Sole Member of Sledgehog Software, trademark and LLC status pending.

User avatar
Yumtard
Posts: 575
Joined: January 19th, 2017, 10:28 pm
Location: Idiot from northern Europe

Re: Noob learns to code in 3 months

Post by Yumtard » June 22nd, 2017, 5:06 pm

Alright I'm done with the homework!
It took some time but was able to make it work. The only thing I forgot was to pass the size for saftey to int2str.
Also made fib() a bit different so it starts counting from 1 and not 0
so if the argument is 3 fib returns 1 while chilis version returns 2
Battlefrog wrote:Volifed sure looks cool for the series.

Also Yumtard, do you mind if I snag the bitmap drawing code from your project? :)
Which are you referring to?
No problem at all :)

User avatar
chili
Site Admin
Posts: 3948
Joined: December 31st, 2011, 4:53 pm
Location: Japan
Contact:

Re: Noob learns to code in 3 months

Post by chili » June 24th, 2017, 11:41 am

Good job finishing the homework on your own bro. I'm interested in seeing how you handle the homework for Tutorial 4 now :)
Chili

User avatar
Yumtard
Posts: 575
Joined: January 19th, 2017, 10:28 pm
Location: Idiot from northern Europe

Re: Noob learns to code in 3 months

Post by Yumtard » June 24th, 2017, 5:04 pm

chili wrote:Good job finishing the homework on your own bro. I'm interested in seeing how you handle the homework for Tutorial 4 now :)
I just started watching part 4 :) However it's already not working for me. The code from the video isn't printing a single pube or dick
int main()
{
std::ifstream in("derp.txt");

while (in.good())
{
_putch(in.get());
}

while( !_kbhit() );
return 0;
}
Edit:
Nvm I had actually managed to name it "derp.txt" :D so derp.txt.txt I guess.
Prints now

User avatar
Yumtard
Posts: 575
Joined: January 19th, 2017, 10:28 pm
Location: Idiot from northern Europe

Re: Noob learns to code in 3 months

Post by Yumtard » June 24th, 2017, 11:58 pm

Watched tutorial 4 today but some friends picked me up to go out and grab a few beers afterwards so didn't have time to start with the hw. But I already know it'll be a tough one... had a couple ideas how maybe I can do it.
Will try tomorrow

User avatar
Yumtard
Posts: 575
Joined: January 19th, 2017, 10:28 pm
Location: Idiot from northern Europe

Re: Noob learns to code in 3 months

Post by Yumtard » June 25th, 2017, 2:46 pm

Don't think I'll be able to do this hw. Getting nowhere with it.

User avatar
chili
Site Admin
Posts: 3948
Joined: December 31st, 2011, 4:53 pm
Location: Japan
Contact:

Re: Noob learns to code in 3 months

Post by chili » June 26th, 2017, 5:56 am

Yumtard, my dawg. My Swedish bro. Not like this.

You've only been at it for like what, 1 day. Gotta give it time bro. Let it percolate, let it ferment.

Break the problem down into small parts, figure out what parts you can tackle, which ones you cannot. Analyze why you are having trouble tackling these parts. And talk it out on this thread, we can give you some nudges in the right directions.
Chili

User avatar
Yumtard
Posts: 575
Joined: January 19th, 2017, 10:28 pm
Location: Idiot from northern Europe

Re: Noob learns to code in 3 months

Post by Yumtard » June 26th, 2017, 10:07 am

chili wrote:Yumtard, my dawg. My Swedish bro. Not like this.

You've only been at it for like what, 1 day. Gotta give it time bro. Let it percolate, let it ferment.

Break the problem down into small parts, figure out what parts you can tackle, which ones you cannot. Analyze why you are having trouble tackling these parts. And talk it out on this thread, we can give you some nudges in the right directions.
Alright chilibro. Just for you I'll rewatch the tutorial and give it another try later today :)

User avatar
Yumtard
Posts: 575
Joined: January 19th, 2017, 10:28 pm
Location: Idiot from northern Europe

Re: Noob learns to code in 3 months

Post by Yumtard » June 26th, 2017, 2:36 pm

Code: Select all

int main()
{
	
	char choice;

	while (choice != 'q')
	{
		chili::print("(l)oad, (s)ave, (a)dd (q)uit or (p)rint?\n\n");
		choice = _getch();

		switch (choice)
		{
		case 'l':
			break;
		case 's':
			break;
		case 'a':
			break;
		case 'p':
			break;
		case 'q':
			break;
		default:
			break;
		}
	} 
	
	while( !_kbhit() );
	return 0;
}
}
This is all I got so far. And then will need a save, add and load function and a print function somehow

User avatar
Yumtard
Posts: 575
Joined: January 19th, 2017, 10:28 pm
Location: Idiot from northern Europe

Re: Noob learns to code in 3 months

Post by Yumtard » June 26th, 2017, 3:18 pm

Code: Select all

class UserEntry
{
public:
	void Add(char* name_in, int val)
	{
		name = name_in;
		value = val;
	}
	void Print()
	{
		chili::print(name);
		chili::print("  |");
		for (int i = 0; i < value; i++)
		{
			_putch('=');
		}
		_putch('\n');
	}

private:
	int value;
	char* name;
};
blargh name = name_in doesn't work.
I guess since it's a pointer, so if I add 2 different entries then they will have different values but the same name

Post Reply