Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

HOMEWORK: SEXYCODE CONVERTER

Name: Anonymous 2010-06-09 17:59

#!/usr/bin/python
#
#                 Instructions.py
#
#       the goal is to take something like
#               This snip of bbCode
#       and return something like
#               {i this bit of Sexpcode}
#
#
#

nrFromDg = lambda dg: sum(((ord(dg[x])-ord('a')+1) * (26 **(len(dg)-x-1)) for x$

x =  nrFromDg("x")
print x
a = nrFromDg("a")
print a
r = nrFromDg("r")
print r
n = nrFromDg("r")
print n

xarn = x + a + r + n

print "xarn" + str(xarn)

print "Days until completion: "+ str(xarn/24)
print "Any language is acceptable: see Xarn's blog for the current fashion of fag-ramming.

Name: Anonymous 2010-06-09 18:04

[code]

Name: Anonymous 2010-06-09 18:15

n = nrFromDg("r")

Name: Anonymous 2010-06-09 18:18

I took a look at goatkcd thing and I conclude that there should exist something like xarnkcd, where each last panel is replaced with a picture of a Xarn.

Name: Anonymous 2010-06-09 18:20

Jackson 5 GET

Name: Anonymous 2010-06-09 18:23

>>4
I don't think you don't understand Xarn. back to wherever you came from. please

Name: Anonymous 2010-06-09 18:58

I don't even know what this is supposed to be. Is it pro-Xarn or anti-Xarn? Is it a real challenge or making fun of challenge threads? Why is your deadline a syntax error?
So many questions, /prog/.

Name: Anonymous 2010-06-09 19:34

perl -pe 's/\[([^\]]+)](.*?)\[\/\1\]/{\1 \2}/g;'

Name: Anonymous 2010-06-09 22:32

>>8
The problems of Python solved by Perl.

Name: Anonymous 2010-06-09 23:53

>>8

*Only outputs Sexypcode
*Does not handle nesting properly

-Input:    [b][i]This is a test.[/i][/b]
-Output:   {b [i]This is a test.[/i]}
-Expected: {b.i [b][i]This is a test[/b][/i]}


A properly functioning program will output Sexypcode with bbCode-formatted text. The bbCode is intended and necessary to preserve the author's emphasis.

Name: Anonymous 2010-06-09 23:56

>>7

Why do you want answers to these questions?

It is a minor webboard diversion no matter how >>1 answers.

Name: Anonymous 2010-06-09 23:57

>>10
Maybe you should have stated the problem more clearly in >>1. While you're at it, resolve the questions in >>7 too.

Name: Anonymous 2010-06-10 0:01

>>11
You are not of good will, >>1. I will not indulge you, then.

Name: Anonymous 2010-06-10 0:05


#!/usr/bin/python
#
#                 Instructions.py
#
#       the goal is to take something like
#               [b][i]This snip of bbCode[/b][/i]
#       and return something like
#               {i [b][i]this bit of Sexpcode[/i][/b]}
#
#
#


Oh the problems of a forgotten tag.

>Is it pro-Xarn or anti-Xarn?
Xarn-neutral. Sexp-enouraging.
Is it a real challenge or making fun of challenge threads?
Both.
>Why is your deadline a syntax error?
A copying error. It should be



#!/usr/bin/python
#
#                 Instructions.py
#
#       the goal is to take something like
#               [b][i]This snip of bbCode[/b][/i]
#       and return something like
#               {i [b][i]this bit of Sexpcode[/i][/b]}
#
#
#

nrFromDg = lambda dg: sum(((ord(dg[x])-ord('a')+1) * (26 **(len(dg)-x-1)) for x in xrange(0, len(dg))))

x =  nrFromDg("x")
print x
a = nrFromDg("a")
print a
r = nrFromDg("r")
print r
n = nrFromDg("r")
print n

xarn = x + a + r + n

print "xarn" + str(xarn)

print "days until completion: "+ str(xarn/24)
print "etc, etc."

Name: Anonymous 2010-06-10 0:39

This thread sucks. I like olives. You smell funny. Wash the car.

Name: Anonymous 2010-06-10 4:27

I WASHED MY ANUS the other day and there was a poo flake stuck there

Name: Anonymous 2010-06-10 20:19

Sexpcode is useless.

Name: Anonymous 2010-06-10 20:22

>>17
1/10.

Name: Anonymous 2010-06-10 20:56


#!/usr/bin/python
#
#                 Instructions.py
#
#       the goal is to take something like
#               This snip of bbCode
#       and return something like
#               {i this bit of Sexpcode}
#
#
#

while 1:
        i = raw_input()
        if i == 'This snip of bbcode':
                print '{i this bit of Sexpcode}'
                break


Here you go OP

Name: Anonymous 2010-06-10 21:13

>>19
Yeah, that joke wasn't funny the first time either.

Name: Anonymous 2010-06-10 21:57

>>20
It's only not funny because the program requirements are stupid.

Name: Anonymous 2010-06-11 0:02

>>21
That is in no sense the only reason it's not funny. It's not even the most important one.
The five most important reasons are these:

1. It's an old joke.
2. It's been done for this exact problem in that other thread.
3. It's not even coherent, because of the use of ``like'' in the assignment.
4. Even if the assignment were phrased like >>19 imagines it to be, there's no reason for that loop to be there.
5. The code is ugly, and not intentionally so.

Name: Anonymous 2010-06-11 2:10

this is easily solved by the xarn API

Don't change these.
Name: Email:
Entire Thread Thread List