Page 43 of 68

Re: Noob learns to code in 3 months

Posted: June 22nd, 2017, 4:37 pm
by Battlefrog
Volifed sure looks cool for the series.

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

Re: Noob learns to code in 3 months

Posted: June 22nd, 2017, 5:06 pm
by Yumtard
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 :)

Re: Noob learns to code in 3 months

Posted: June 24th, 2017, 11:41 am
by chili
Good job finishing the homework on your own bro. I'm interested in seeing how you handle the homework for Tutorial 4 now :)

Re: Noob learns to code in 3 months

Posted: June 24th, 2017, 5:04 pm
by Yumtard
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

Re: Noob learns to code in 3 months

Posted: June 24th, 2017, 11:58 pm
by Yumtard
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

Re: Noob learns to code in 3 months

Posted: June 25th, 2017, 2:46 pm
by Yumtard
Don't think I'll be able to do this hw. Getting nowhere with it.

Re: Noob learns to code in 3 months

Posted: June 26th, 2017, 5:56 am
by chili
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.

Re: Noob learns to code in 3 months

Posted: June 26th, 2017, 10:07 am
by Yumtard
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 :)

Re: Noob learns to code in 3 months

Posted: June 26th, 2017, 2:36 pm
by Yumtard

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

Re: Noob learns to code in 3 months

Posted: June 26th, 2017, 3:18 pm
by Yumtard

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