Raptor and reversing a sting??? - MacRumors Forums
Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Apr 7, 2012, 05:47 PM   #1
Silverbird0000
macrumors 6502a
 
Join Date: Sep 2006
Location: Fort Myers, FL
Send a message via AIM to Silverbird0000
Raptor and reversing a sting???

I have to submit code for my class where I design a program that prompts the user to enter a string and then displays the string contents backward. For instance, if the user entered "gravity" the program should display "ytivarg." I have the python code done. To reverse the word I used, word = raw_input, then print word [::-1]. But I can not figure out how to make it work in Raptor. I don't know the language to use to make it reverse a string. Any help would be appreciated as this assignment is due tonight! Thanks!!
__________________
15" 2.7GHz Core i7 Retina MacBook Pro (Early 2013)
Silver 32GB iPhone 5s, iPad 32GB WiFi (3rd Gen)
27" LED Cinema Display, iPod Collection, ATV3
Silverbird0000 is offline   0 Reply With Quote
Old Apr 7, 2012, 06:54 PM   #2
jared_kipe
macrumors 68030
 
jared_kipe's Avatar
 
Join Date: Dec 2003
Location: Seattle
Send a message via AIM to jared_kipe
First off, Python basically 'cheats' at this so just because you can do it in Python doesn't mean you've mastered the concept of reversing a string. Most languages don't have a built in function that will do it without thinking about it.

Secondly, what is 'Raptor' all I can find is some kind of flow chart language which seems like it can't be right.

EDIT: Actually this probably is the 'Raptor' you're referring to. You need to think of what is actually required to reverse a string. One way would be to use a concept of a stack or recursion. Another way would be to use built in string language constructs that prepend strings if available.
jared_kipe is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
Reversing Motion Titles in FCP RoverStar Digital Video 2 Apr 25, 2014 04:21 PM
OS X: EURO TRUCK SIMULATOR 2 - Reversing tips DeafRaiders Mac and PC Games 1 Mar 23, 2013 01:52 AM
AT&T Not reversing my upgrade ricanloveee iPhone 0 Sep 24, 2012 11:42 AM
Reversing an app update achtungfemme iPad 1 Aug 27, 2012 03:50 PM

Forum Jump

All times are GMT -5. The time now is 01:24 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC