caramoan tour package

caramoan tour package

Author Topic: Share your Simple but tricky Programming Exercises...  (Read 4450 times)

Offline 0b00000111

  • Technical People
  • Solar Power Satellite
  • *****
  • Posts: 6129
  • Pogi/Ganda Points: 398
  • There is no delight in owning anything unshared.
Re: Share your Simple but tricky Programming Exercises...
« Reply #20 on: September 14, 2010, 10:11:50 PM »
;D ;D ;D

di ko nga pala napost yung solution ko

Code: [Select]
import string

myStr = "Doogsauumauipnt >)! Zov qatsfd!ovr!ieipt!fjlues >) Wiau brf zovr!tirfe!fbvprjtf uedhoidam copkt? Pmebsf jndlvdf bt!lfatt!ooe!spfuwbrf fnhioefrjnh copk- uhf ptiess!cbn!bf xhbtfvfr- j.f.- qhzsjct,!mbti,!euc/"
myLst = []
ctr = 0
for myChar in myStr:
ctr+=1
myLst.append(chr(ord(myChar)-(ctr%2)))
print string.join(myLst,'')

E-Gizmo Mechatronix Central: www.e-gizmo.com

Tel #: (63)(2) 536-3378
Globe +63915-973-7691
Smart +63921-779-0748

Location Map

YM: julie.egizmo  aka Born2BeWired  ;D

Philippine Electronics Forum

Re: Share your Simple but tricky Programming Exercises...
« Reply #20 on: September 14, 2010, 10:11:50 PM »

Offline Kaizer03

  • Nuclear Reactor
  • ****
  • Posts: 4847
  • Pogi/Ganda Points: 225
  • C#<-->Android<-->Java
    • PhilRobotics
Re: Share your Simple but tricky Programming Exercises...
« Reply #21 on: September 14, 2010, 10:18:32 PM »
sobrang igsi nga sa python ah..

yung sa akin ang haba..though pede pa naman paigsiin..mas maikli lang talaga sa python... tsk.. naccrave akong balikan ang pag-aaral ko nyan=) (i mean nag-aral dati pero walang application)

:D
Lend a hand for those who are in need!=)

Stop Hijacking!=) More Technical Posts!=)
 ;)

Kaizer Killer EX Pre-Alpha

Philippine Electronics Forum

Re: Share your Simple but tricky Programming Exercises...
« Reply #21 on: September 14, 2010, 10:18:32 PM »

Offline tiktak

  • Gas Turbine
  • **
  • Posts: 2859
  • Pogi/Ganda Points: 203
  • Gender: Male
    • Tiktakx's Blog
Re: Share your Simple but tricky Programming Exercises...
« Reply #22 on: September 14, 2010, 10:23:02 PM »
grabe ang igsi nga!
8051 stuff

Philippine Electronics Forum

Re: Share your Simple but tricky Programming Exercises...
« Reply #22 on: September 14, 2010, 10:23:02 PM »

Offline 0b00000111

  • Technical People
  • Solar Power Satellite
  • *****
  • Posts: 6129
  • Pogi/Ganda Points: 398
  • There is no delight in owning anything unshared.
Re: Share your Simple but tricky Programming Exercises...
« Reply #23 on: September 14, 2010, 10:23:20 PM »
ok yung naisip ni sis zerowing, nag bitwise operator tapos multiply sa -1... ill remember that technique (magagamit ko yan balang araw... pasok sa toolbox ko! ganda point sa iyo tita regie) ;D

thanks sa mga pumatol sa exercise na ito hehehe :D
E-Gizmo Mechatronix Central: www.e-gizmo.com

Tel #: (63)(2) 536-3378
Globe +63915-973-7691
Smart +63921-779-0748

Location Map

YM: julie.egizmo  aka Born2BeWired  ;D

Philippine Electronics Forum

Re: Share your Simple but tricky Programming Exercises...
« Reply #23 on: September 14, 2010, 10:23:20 PM »

Offline 0b00000111

  • Technical People
  • Solar Power Satellite
  • *****
  • Posts: 6129
  • Pogi/Ganda Points: 398
  • There is no delight in owning anything unshared.
Re: Share your Simple but tricky Programming Exercises...
« Reply #24 on: September 14, 2010, 10:28:17 PM »
btw, wag nyo muna post yung decrypted message para doon sa mga gusto mag-try  :) magandang exercise ito hehehe :) basta post nyo lang mga solutions nyo ;D
E-Gizmo Mechatronix Central: www.e-gizmo.com

Tel #: (63)(2) 536-3378
Globe +63915-973-7691
Smart +63921-779-0748

Location Map

YM: julie.egizmo  aka Born2BeWired  ;D

Philippine Electronics Forum

Re: Share your Simple but tricky Programming Exercises...
« Reply #24 on: September 14, 2010, 10:28:17 PM »

Offline anthonydp

  • Size D Battery
  • ******
  • Posts: 320
  • Pogi/Ganda Points: 54
  • Gender: Male
    • My Empty Blog
Re: Share your Simple but tricky Programming Exercises...
« Reply #25 on: September 14, 2010, 10:43:21 PM »
puede natin ituloy dito:

http://www.pythonchallenge.com/

para sabay-sabaw tayo matuto ng python.
your question appears to be an XY Problem.

why don't you just tell us exactly what you're trying to do?

Offline tiktak

  • Gas Turbine
  • **
  • Posts: 2859
  • Pogi/Ganda Points: 203
  • Gender: Male
    • Tiktakx's Blog
Re: Share your Simple but tricky Programming Exercises...
« Reply #26 on: September 14, 2010, 10:48:33 PM »
Congratulations ;D ;D ;D hahaha magandang pang anti spam
8051 stuff

Offline 0b00000111

  • Technical People
  • Solar Power Satellite
  • *****
  • Posts: 6129
  • Pogi/Ganda Points: 398
  • There is no delight in owning anything unshared.
Re: Share your Simple but tricky Programming Exercises...
« Reply #27 on: September 14, 2010, 10:55:34 PM »
sis anthonydp,

thanks :) ganda nito. sinisimulan ko na. currently nasa level 3 pa lang ako...
E-Gizmo Mechatronix Central: www.e-gizmo.com

Tel #: (63)(2) 536-3378
Globe +63915-973-7691
Smart +63921-779-0748

Location Map

YM: julie.egizmo  aka Born2BeWired  ;D

Offline Kaizer03

  • Nuclear Reactor
  • ****
  • Posts: 4847
  • Pogi/Ganda Points: 225
  • C#<-->Android<-->Java
    • PhilRobotics
Re: Share your Simple but tricky Programming Exercises...
« Reply #28 on: September 14, 2010, 10:58:42 PM »
here's mine in C#, edited na.. compressed compare sa una kong gawa, and kuha ng idea kay manay=)

Code: [Select]
string ConStr = null, str = "Doogsauumauipnt >)! Zov qatsfd!ovr!ieipt!fjlues >) Wiau brf zovr!tirfe!fbvprjtf uedhoidam copkt? Pmebsf jndlvdf bt!lfatt!ooe!spfuwbrf fnhioefrjnh copk- uhf ptiess!cbn!bf xhbtfvfr- j.f.- qhzsjct,!mbti,!euc/";
            char[] chq = str.ToCharArray();

            int ctr =0, chp = 0;
            
            foreach (Int32 cht in chq)
            {
                ctr++;
                chp = cht;

                if (ctr % 2 != 0)
                    chp = cht - 1;

                ConStr += Convert.ToChar(chp);
            }
            MessageBox.Show(ConStr);

BTW, kaya ko nagkakaroon ng error kanina.. instead na space lang naging newline... ano ba talaga newline sya or space lang? sa unang post kasi ni manay eh nakanewline yung last Line,=)
Lend a hand for those who are in need!=)

Stop Hijacking!=) More Technical Posts!=)
 ;)

Kaizer Killer EX Pre-Alpha

Offline 0b00000111

  • Technical People
  • Solar Power Satellite
  • *****
  • Posts: 6129
  • Pogi/Ganda Points: 398
  • There is no delight in owning anything unshared.
Re: Share your Simple but tricky Programming Exercises...
« Reply #29 on: September 14, 2010, 11:03:37 PM »
^^ im not sure, sa python kasi very readable yung lumalabas at wala namang error :D ;D i think mahalaga lang naman from the employer is maintindihan yung decrypyed question. ;D
E-Gizmo Mechatronix Central: www.e-gizmo.com

Tel #: (63)(2) 536-3378
Globe +63915-973-7691
Smart +63921-779-0748

Location Map

YM: julie.egizmo  aka Born2BeWired  ;D

Offline Kaizer03

  • Nuclear Reactor
  • ****
  • Posts: 4847
  • Pogi/Ganda Points: 225
  • C#<-->Android<-->Java
    • PhilRobotics
Re: Share your Simple but tricky Programming Exercises...
« Reply #30 on: September 14, 2010, 11:13:55 PM »
^

hehe ganun ba.. ganun din pala.. kulang yung code ko sa taas, yung spaces nya nagiging square.. though fix na sya yung nasa akin dito..including yung newline..

pero ayun, sabagay.. basang basa naman sya..recapping mode nga sa python(isip ng application) =)

thanks ulet=)
Lend a hand for those who are in need!=)

Stop Hijacking!=) More Technical Posts!=)
 ;)

Kaizer Killer EX Pre-Alpha

Offline rdpzycho

  • Technical People
  • Solar Power Satellite
  • *****
  • Posts: 10728
  • Pogi/Ganda Points: 632
  • Gender: Male
  • Respect Begets Respect
    • rdpzycho
Re: Share your Simple but tricky Programming Exercises...
« Reply #31 on: September 14, 2010, 11:24:13 PM »
i think mahalaga lang naman from the employer is maintindihan yung decrypyed question. ;D

minano-mano ko nga. ;D kaya 'di ko na-decrypt 'yung buong message, tinamad na ako. ;D ;D ;D
‎"Divide each difficulty into as many parts as is feasible and necessary to resolve it."
- Rene Descartes

"For every difficult problem there is always a simple answer and most of them are wrong."
- Clayton Paul

Offline 0b00000111

  • Technical People
  • Solar Power Satellite
  • *****
  • Posts: 6129
  • Pogi/Ganda Points: 398
  • There is no delight in owning anything unshared.
Re: Share your Simple but tricky Programming Exercises...
« Reply #32 on: September 14, 2010, 11:34:17 PM »
nawili ako... kasalanan ito ni sis anthonydp :D :D :D

meron ding encryption sa level 3  :D

g fmnc wms bgblr rpylqjyrc gr zw fylb. rfyrq ufyr amknsrcpq ypc dmp. bmgle gr gl zw fylb gq glcddgagclr ylb rfyr'q ufw rfgq rcvr gq qm jmle. sqgle qrpgle.kyicrpylq() gq pcamkkclbcb. lmu ynnjw ml rfc spj.

madali rin siya idecrypt :D :D :D

level 4 na ako... bukas ko na pagpapatuloy  sa office :D   walang trabaho bukas... eto ang gagawin ko magdamag :D :D :D
E-Gizmo Mechatronix Central: www.e-gizmo.com

Tel #: (63)(2) 536-3378
Globe +63915-973-7691
Smart +63921-779-0748

Location Map

YM: julie.egizmo  aka Born2BeWired  ;D

Offline marcelino

  • Technical People
  • Solar Power Satellite
  • *****
  • Posts: 6016
  • Pogi/Ganda Points: 258
  • ...keep moving forward! - Robinson's
Re: Share your Simple but tricky Programming Exercises...
« Reply #33 on: September 15, 2010, 12:00:09 AM »
nakita ko ang message...
pero di ko pa naiintindihan kung papano. heheh ;D

masubukan din nga.

:D
"Don't take life seriously. After all, no one has ever come out of it alive. -Bugs Bunny"

Offline marcelino

  • Technical People
  • Solar Power Satellite
  • *****
  • Posts: 6016
  • Pogi/Ganda Points: 258
  • ...keep moving forward! - Robinson's
Re: Share your Simple but tricky Programming Exercises...
« Reply #34 on: September 15, 2010, 12:15:04 AM »
medyo nakuha ko na din kung papano naging D = C...
hay naku! aside sa naguluhan ako ng logics, di pa ako marunong magpython. hehehe
"Don't take life seriously. After all, no one has ever come out of it alive. -Bugs Bunny"

Offline Kaizer03

  • Nuclear Reactor
  • ****
  • Posts: 4847
  • Pogi/Ganda Points: 225
  • C#<-->Android<-->Java
    • PhilRobotics
Re: Share your Simple but tricky Programming Exercises...
« Reply #35 on: September 15, 2010, 12:28:47 AM »
^

nice.. tuloy tuloy na yan sir... kahit dun ka lang muna sir sa Congratulations heheh =)
Lend a hand for those who are in need!=)

Stop Hijacking!=) More Technical Posts!=)
 ;)

Kaizer Killer EX Pre-Alpha

Offline NanotecH

  • Lead Acid Battery
  • *******
  • Posts: 779
  • Pogi/Ganda Points: 44
Re: Share your Simple but tricky Programming Exercises...
« Reply #36 on: September 15, 2010, 02:01:24 AM »
Cover letter:
Please include a detailed cover letter in your response, telling us about your technical background, a bit about your life history and interests, and answering the following question (you have to 'decrypt' it first =). If you can't decipher the question, please don't respond.

Doogsauumauipnt >)! Zov qatsfd!ovr!ieipt!fjlues >) Wiau brf zovr!tirfe!fbvprjtf uedhoidam copkt? Pmebsf jndlvdf bt!lfatt!ooe!spfuwbrf fnhioefrjnh copk-
uhf ptiess!cbn!bf xhbtfvfr- j.f.- qhzsjct,!mbti,!euc/

We are looking forward to hearing from you!

quote doon sa isang job site :D

parang yan yung job listing ng isang company sa sta. monica... ;D

eto sa Microsoft Small Basic:
Code: [Select]
text = "Doogsauumauipnt >)! Zov qatsfd!ovr!ieipt!fjlues >) Wiau brf zovr!tirfe!fbvprjtf uedhoidam copkt? Pmebsf jndlvdf bt!lfatt!ooe!spfuwbrf fnhioefrjnh copk- uhf ptiess!cbn!bf xhbtfvfr- j.f.- qhzsjct,!mbti,!euc/"
len = Text.GetLength(text)
For a = 1 To len Step 2
  data1 = Text.GetSubText(text,a, 1)
  data1a = text.GetCharacterCode(data1)
  data1b = text.GetCharacter(data1a - 1)
  data2 = text.GetSubText(text, a+1, 1)
  data3 = Text.Append(data1b, data2)
  TextWindow.Write(data3)
EndFor
220V/10A input = 220V/30A output...Fact or Fiction?  Myth or Reality?
One word is enough for a wise man.
"Never tell the truth to people who are not worthy of it." - Mark Twain

Offline zer0w1ng

  • Technical People
  • Gas Turbine
  • *****
  • Posts: 2179
  • Pogi/Ganda Points: 305
  • Gender: Male
  • Enter any 11-digit prime number to continue...
    • The Cebuano Geek
Re: Share your Simple but tricky Programming Exercises...
« Reply #37 on: September 15, 2010, 07:05:10 AM »
Code: [Select]
inp = "g fmnc wms bgblr rpylqjyrc gr zw fylb. rfyrq ufyr amknsrcpq ypc dmp. bmgle gr gl zw fylb gq glcddgagclr ylb rfyr'q ufw rfgq rcvr gq qm jmle. sqgle qrpgle.kyicrpylq() gq pcamkkclbcb. lmu ynnjw ml rfc spj."

out = ""
for a in inp:
if a <>' ':
out = out + chr(ord('a') + ( ord(a) - ord('a') + 2) % 26)
else:
out = out + a

print out


#solution 2##
import string

table1 = 'yzabcdefghijklmnopqrstuvwx '
table2 = 'abcdefghijklmnopqrstuvwxyz '

t = string.maketrans(table1, table2)
print inp.translate(t)
The Cebuano Geek

Offline 0b00000111

  • Technical People
  • Solar Power Satellite
  • *****
  • Posts: 6129
  • Pogi/Ganda Points: 398
  • There is no delight in owning anything unshared.
Re: Share your Simple but tricky Programming Exercises...
« Reply #38 on: September 15, 2010, 08:30:57 AM »
nakakatuwa yung maketrans (actually, kagabi ko lang nalaman ito hehehe)... after ko masolve yung message nagbigay siya ng hint to use maketrans. dami ko pa kelangang aralin sa python :D ;D

Code: [Select]
import string
translationtable=string.maketrans(string.ascii_lowercase,string.ascii_lowercase[2:]+'ab')
print "g fmnc wms bgblr rpylqjyrc gr zw fylb. rfyrq ufyr amknsrcpq ypc dmp. bmgle gr gl zw fylb gq glcddgagclr ylb rfyr'q ufw rfgq rcvr gq qm jmle. sqgle qrpgle.kyicrpylq() gq pcamkkclbcb. lmu ynnjw ml rfc spj.".translate(translationtable)
E-Gizmo Mechatronix Central: www.e-gizmo.com

Tel #: (63)(2) 536-3378
Globe +63915-973-7691
Smart +63921-779-0748

Location Map

YM: julie.egizmo  aka Born2BeWired  ;D

Offline zer0w1ng

  • Technical People
  • Gas Turbine
  • *****
  • Posts: 2179
  • Pogi/Ganda Points: 305
  • Gender: Male
  • Enter any 11-digit prime number to continue...
    • The Cebuano Geek
Re: Share your Simple but tricky Programming Exercises...
« Reply #39 on: September 15, 2010, 10:19:33 AM »
Apply ka na sis.
The Cebuano Geek

Philippine Electronics Forum

Re: Share your Simple but tricky Programming Exercises...
« Reply #39 on: September 15, 2010, 10:19:33 AM »

 

Privacy Policy

Contact Us: elabph@yahoo.com