This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#301 2012-10-24 12:29:49

TRocket
Scratcher
Registered: 2009-08-18
Posts: 1000+

Re: Itchy++ - a Scratch C++ Port

300th post on this topic!


http://i.imgur.com/1QqnHxQ.png

Offline

 

#302 2012-10-24 13:35:57

DigiTechs
Scratcher
Registered: 2011-04-30
Posts: 500+

Re: Itchy++ - a Scratch C++ Port

TRocket, as you know C++, wound you be helpful enough and explain why this code only writes "9 [tab] 6" if I input an IP beginning with 96.?

Code:

#include "CustomHostsGenerator.h"
using namespace std;
int main ( )
{
    char c;
    char v;
    cout<<"Please input your desired IP."<<endl;
    cout<<"i.e.: 192.168.0.1"<<endl;
    cin>>c;
    cout<<endl;
    cout<<"Now insert your desired hostname."<<endl;
    cout<<"ie.: 192.168.0.1 would be router.int"<<endl;
    cin>>v;
    cout<<endl;
    ofstream file;
    file.open("C:\\Windows\\System32\\drivers\\etc\\hosts", ios_base::app);
    file<<c<<"    "<<v;
    file.close( );
    cout<<"Wrote "<<c<<"    "<<v<<" to the hosts file. Enjoy!";
    system("PAUSE");
    return 0;
};

Also, if you want to know what "CustomHostsGenerator.h" contains; it's only this:

Code:

#include <iostream>
#include <fstream>

Last edited by DigiTechs (2012-10-24 13:36:49)


I'm back.
Maybe.

Offline

 

#303 2012-10-24 14:18:26

TRocket
Scratcher
Registered: 2009-08-18
Posts: 1000+

Re: Itchy++ - a Scratch C++ Port

change line 5 to

Code:

char *c = new char;

and line 6 to

Code:

char *v = new char;

you had initialized c and v as single characters so, only one character could be read and the rest of the input overflowed into the next cin(which also only read one character).
I think that's right, It worked when i ran it just now, but i'm not really that good at C++  tongue

Last edited by TRocket (2012-10-24 14:19:56)


http://i.imgur.com/1QqnHxQ.png

Offline

 

#304 2012-10-24 14:43:15

DigiTechs
Scratcher
Registered: 2011-04-30
Posts: 500+

Re: Itchy++ - a Scratch C++ Port

Ok. I'll try that
EDIT: Thanks! It worked!

Also, I changed line 18 so it's this, to not make too much things on one line.
file<<endl<<c<<"    "<<v;

So basically, it moves a line down BEFORE adding any text in.

Last edited by DigiTechs (2012-10-24 14:52:17)


I'm back.
Maybe.

Offline

 

#305 2012-10-24 16:26:51

pwiter
Scratcher
Registered: 2010-06-02
Posts: 100+

Re: Itchy++ - a Scratch C++ Port

@DigiTechs
I see your working on something that bobbybee is working on already xD


http://i.imgur.com/YBeXc.png

Offline

 

#306 2012-10-24 16:30:10

DigiTechs
Scratcher
Registered: 2011-04-30
Posts: 500+

Re: Itchy++ - a Scratch C++ Port

pwiter wrote:

@DigiTechs
I see your working on something that bobbybee is working on already xD

Not exactly xP. His downloads data, with mine you can create them customly.


I'm back.
Maybe.

Offline

 

#307 2012-10-24 21:17:39

pwiter
Scratcher
Registered: 2010-06-02
Posts: 100+

Re: Itchy++ - a Scratch C++ Port

DigiTechs wrote:

pwiter wrote:

@DigiTechs
I see your working on something that bobbybee is working on already xD

Not exactly xP. His downloads data, with mine you can create them customly.

xD


http://i.imgur.com/YBeXc.png

Offline

 

#308 2012-10-24 21:25:34

pwiter
Scratcher
Registered: 2010-06-02
Posts: 100+

Re: Itchy++ - a Scratch C++ Port

Um... TRocket, whats the code for your Signature?


http://i.imgur.com/YBeXc.png

Offline

 

#309 2012-10-25 02:23:42

TRocket
Scratcher
Registered: 2009-08-18
Posts: 1000+

Re: Itchy++ - a Scratch C++ Port

pwiter wrote:

Um... TRocket, whats the code for your Signature?

Code:

[url=http://scratch.mit.edu/forums/viewtopic.php?id=105454&p=1][img]http://i.imgur.com/YBeXc.png[/img][/url]

http://i.imgur.com/1QqnHxQ.png

Offline

 

#310 2012-10-25 02:26:40

s_federici
Scratcher
Registered: 2007-12-18
Posts: 500+

Re: Itchy++ - a Scratch C++ Port

TRocket wrote:

If you want to help Develop please tell me your Github username!

If you are still looking for developers/testers, let me know how I can help.

Offline

 

#311 2012-10-25 06:17:34

DigiTechs
Scratcher
Registered: 2011-04-30
Posts: 500+

Re: Itchy++ - a Scratch C++ Port

Meh. I'm a complete newbie to C++, so all I would like to do is look at the source code. So I can learn from it  smile


I'm back.
Maybe.

Offline

 

#312 2012-10-25 06:40:38

blob8108
Scratcher
Registered: 2007-06-25
Posts: 1000+

Re: Itchy++ - a Scratch C++ Port

DigiTechs wrote:

Meh. I'm a complete newbie to C++, so all I would like to do is look at the source code. So I can learn from it  smile

Source is heresmile


Things I've made: kurt | scratchblocks2 | this cake

Offline

 

#313 2012-10-25 06:42:14

DigiTechs
Scratcher
Registered: 2011-04-30
Posts: 500+

Re: Itchy++ - a Scratch C++ Port

blob8108 wrote:

DigiTechs wrote:

Meh. I'm a complete newbie to C++, so all I would like to do is look at the source code. So I can learn from it  smile

Source is heresmile

Thank you  big_smile  Now I can learn!


I'm back.
Maybe.

Offline

 

#314 2012-10-25 07:36:29

nXIII
Community Moderator
Registered: 2009-04-21
Posts: 1000+

Re: Itchy++ - a Scratch C++ Port

@MathWizz LargePositiveIntegers and LargeNegativeIntegers are variable-length:

getBigInt: anObject id: classID

    | digitCount result |
    digitCount _ stream uint16.
    result _ (self classForID: classID) new: digitCount.
    1 to: digitCount do: [:i | result digitAt: i put: stream next].
    ^ result

putBigInt: anObject id: classID

    firstPass ifTrue: [^ self].
    stream nextPut: classID.
    stream uint16: anObject digitLength.
    1 to: anObject digitLength do: [:i | stream nextPut: (anObject digitAt: i)].


nXIII

Offline

 

#315 2012-10-25 10:42:02

MathWizz
Scratcher
Registered: 2009-08-31
Posts: 1000+

Re: Itchy++ - a Scratch C++ Port

@nXIII - I didn't write it, but I've been to laxy too fix it.  tongue

Last edited by MathWizz (2012-10-25 10:42:14)


http://block.site90.net/scratch.mit/text.php?size=30&amp;text=%20A%20signature!&amp;color=333333

Offline

 

#316 2012-10-25 11:37:43

TRocket
Scratcher
Registered: 2009-08-18
Posts: 1000+

Re: Itchy++ - a Scratch C++ Port

s_federici wrote:

TRocket wrote:

If you want to help Develop please tell me your Github username!

If you are still looking for developers/testers, let me know how I can help.

yep, we're still looking for any help people are willing to offer!
Please can you tell me your github username and i'll add you!


http://i.imgur.com/1QqnHxQ.png

Offline

 

#317 2012-10-25 13:19:16

ahirbhairav
Scratcher
Registered: 2012-10-06
Posts: 100+

Re: Itchy++ - a Scratch C++ Port

Can I do testing?

Offline

 

#318 2012-10-25 14:36:13

TRocket
Scratcher
Registered: 2009-08-18
Posts: 1000+

Re: Itchy++ - a Scratch C++ Port

ahirbhairav wrote:

Can I do testing?

sure, i'll add you to the list...


http://i.imgur.com/1QqnHxQ.png

Offline

 

#319 2012-10-25 15:09:14

ahirbhairav
Scratcher
Registered: 2012-10-06
Posts: 100+

Re: Itchy++ - a Scratch C++ Port

How do I get the program?

Offline

 

#320 2012-10-25 15:11:51

TRocket
Scratcher
Registered: 2009-08-18
Posts: 1000+

Re: Itchy++ - a Scratch C++ Port

ahirbhairav wrote:

How do I get the program?

currently the very latest windows version is available here


http://i.imgur.com/1QqnHxQ.png

Offline

 

#321 2012-10-25 15:39:24

s_federici
Scratcher
Registered: 2007-12-18
Posts: 500+

Re: Itchy++ - a Scratch C++ Port

TRocket wrote:

Please can you tell me your github username and i'll add you!

It's sfederici. How do I know what I could help with first? Is there a way to "mark" something as in development?

Offline

 

#322 2012-10-25 16:13:11

TRocket
Scratcher
Registered: 2009-08-18
Posts: 1000+

Re: Itchy++ - a Scratch C++ Port

s_federici wrote:

TRocket wrote:

Please can you tell me your github username and i'll add you!

It's sfederici. How do I know what I could help with first? Is there a way to "mark" something as in development?

i've added you. Just post on this thread and say you're working on it, we probably check it more than we check github  tongue

EDIT: if you want an "easy" thing so you can get used to the scratch 1.x reading code a bit maybe you could implement what was said further up this page...

Last edited by TRocket (2012-10-25 16:15:09)


http://i.imgur.com/1QqnHxQ.png

Offline

 

#323 2012-10-26 19:20:16

ahirbhairav
Scratcher
Registered: 2012-10-06
Posts: 100+

Re: Itchy++ - a Scratch C++ Port

It doesn't run; I need libexpat.dll to run. Where do I get that?

BTW my github username is ahirbhairav

Last edited by Paddle2See (2012-10-26 19:49:23)

Offline

 

#324 2012-10-26 19:36:00

pwiter
Scratcher
Registered: 2010-06-02
Posts: 100+

Re: Itchy++ - a Scratch C++ Port

ahirbhairav wrote:

It doesn't run; I need libexpat.dll to run. Where do I get that?

Hm...
It's somewhere on this post, looking for it.

EDIT: Found it it's here: http://ftp.gnome.org/pub/gnome/binaries … endencies/

Last edited by pwiter (2012-10-26 19:36:17)


http://i.imgur.com/YBeXc.png

Offline

 

#325 2012-10-26 22:29:55

ahirbhairav
Scratcher
Registered: 2012-10-06
Posts: 100+

Re: Itchy++ - a Scratch C++ Port

Too many libs, which file?

Offline

 

Board footer