Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Assignment 1 - CS193p for Fall 2011
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  5 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Fernando Crespo  
View profile  
 More options Nov 22 2011, 6:56 am
From: Fernando Crespo <fernand...@gmail.com>
Date: Tue, 22 Nov 2011 03:56:16 -0800 (PST)
Local: Tues, Nov 22 2011 6:56 am
Subject: Assignment 1 - CS193p for Fall 2011

Hi, could you guys enlighten me a little bit?

I'm watching CS193p for Fall 2011 in iTunes U.

I'm trying to implement PI as an operation but it's inserting in the stack
twice.

So if I press 3 PI * the result is 9.8696 witch is actually the result of
PI PI *!

Can somebody help a bit?

Where did you put the code to treat that? I think the best place is in
popOperandOffStack, am I right?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Rob Todd  
View profile  
 More options Nov 22 2011, 9:51 am
From: Rob Todd <rwt...@gmail.com>
Date: Tue, 22 Nov 2011 09:51:23 -0500
Local: Tues, Nov 22 2011 9:51 am
Subject: Re: [iPhone-AppDev-Auditors] Assignment 1 - CS193p for Fall 2011

Yes, popOperandOffStack is the likely place for PI to go... are you hitting "enter" in between 3 and PI?  If not, then PI should be the only thing on the stack when the "*" operation is triggered and thus the result should be zero I would think because "*" is a two operand operation and there is only one operand on the stack.  

Maybe insert some NSLogs in to popOperandOffStack to see what the contents of the stack actually are during the recursion?

Rob

On Nov 22, 2011, at 6:56 AM, Fernando Crespo wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Fernando Crespo  
View profile  
 More options Nov 22 2011, 11:33 am
From: Fernando Crespo <fernand...@gmail.com>
Date: Tue, 22 Nov 2011 08:33:46 -0800 (PST)
Local: Tues, Nov 22 2011 11:33 am
Subject: Re: [iPhone-AppDev-Auditors] Assignment 1 - CS193p for Fall 2011

Thank you for the insight.

It happens that the performOperation command already fires enterPressed if
the userIsInMiddleOfEnteringNumber, so pressing Enter between 3 and πis not
really necessary. I guess it's entering that case when it shouldn't.

I'll make some logs and post back my results.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Fernando Crespo  
View profile  
 More options Nov 24 2011, 8:40 pm
From: Fernando Crespo <fernand...@gmail.com>
Date: Thu, 24 Nov 2011 17:40:35 -0800 (PST)
Local: Thurs, Nov 24 2011 8:40 pm
Subject: Re: [iPhone-AppDev-Auditors] Assignment 1 - CS193p for Fall 2011

I've managed to make it work!!! :-)

I had to remove the line that pushes the result onto the stack again.

//    [self.model pushOperand:result]; // Insert the result in the program

I've found this answer because it's how the RPN in Mac works.

I did the descriptionOfProgram too, my result for 5 E 3 + 6 + is shown as
"((5 + 3) + 6" while the display shows 14 wich is the result.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
MobileDevVT  
View profile  
 More options Feb 16, 2:12 pm
From: MobileDevVT <mobilede...@gmail.com>
Date: Thu, 16 Feb 2012 11:12:56 -0800 (PST)
Local: Thurs, Feb 16 2012 2:12 pm
Subject: Re: [iPhone-AppDev-Auditors] Assignment 1 - CS193p for Fall 2011

I don't think you need to change pushOperand method. I have only changed
performOperation: to implement Pi from Task 3 of the Assignment 1. You can
find my solution at my blog. Not sure if it's correct but it is mine.
http://mobiledevvt.blogspot.com/2012/02/cs193p-fall-2011-iphone-appli...


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »