A community for students.

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing


  • 4 years ago

Hey, I'm working on ps3c... when I use the prof's function the program is getting caught up on my string search functions. Looks like they are stuck in an infinite loop, but they don't do this when run separately from the prof's function. I'd appreciate any insight from anyone... thanks!! (Also, both have this problem, but I tried iterative and recursive versions of the string searching functions. Here are (1): the searching functions I've written and (2): my ps3c code with the iterative search function implemented.) (1): http://codepad.org/BIxFpQeC (2): http://codepad.org/AozcGj7T

  • This Question is Closed
  1. anonymous
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    length = len(firstMatch) in constrainedMatchPair function seem to be a mistake length should be just length from the input http://dpaste.com/hold/693977/ http://dpaste.com/hold/693698/

  2. anonymous
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    Ah, yeah I caught that earlier too, although you don't need to assign it to a variable in the definition - you can just use 'length' in the equation. That wasn't why it was caught in an infinite loop though - that problem was caused because my subStringMatchExact function couldn't handle empty strings, so I put in a condition for that. Take a look / thank so much for answering / I'll repay the favor :) http://codepad.org/jcm3zKVm

  3. Not the answer you are looking for?
    Search for more explanations.

    • Attachments:

Ask your own question

Sign Up
Find more explanations on OpenStudy
Privacy Policy

Your question is ready. Sign up for free to start getting answers.

spraguer (Moderator)
5 → View Detailed Profile

is replying to Can someone tell me what button the professor is hitting...


  • Teamwork 19 Teammate
  • Problem Solving 19 Hero
  • You have blocked this person.
  • ✔ You're a fan Checking fan status...

Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.

This is the testimonial you wrote.
You haven't written a testimonial for Owlfred.