Hey all,
If you've seen my previous post, "Help (I suck @ c)", you'll see where this is going.
For those who haven't, here's the gist :
I took this basic python code :

Code:
#get input
colours = [input("Enter Charater 1 : "),input("Enter Charater 2 : ")]
colour_length = int(input("Enter desired Character length (Whole Number) : "))
pattern_length = int(input("Enter desired scarf length (Whole Number) : "))
pattern_width = int(input("Enter desired scarf width (Whole Number) : "))

#print scarf
print()
print("Here is your scarf :")
for pos in range(int(pattern_width * pattern_length)):
    print(colours[ int((pos)/colour_length) % len(colours)], end="")
    if (pos % pattern_width) == pattern_width-1:
        print("")

...and ported it to various programming languages

my goal is to port this code to as many (non esoteric) languages as possible

I have a github repo for this project here : https://github.com/Izder456/scarf

If you're lazy like me, and just want to run the code without downloading/installing, click these links (it runs in the browser) :
> For Python 3 : https://scarfpy.isaacmeyer.repl.run
> For Node.js : https://scarfjs.isaacmeyer.repl.run
> For JSF*** : https://scarfjsf.isaacmeyer.repl.run
> For C : https://scarfc.isaacmeyer.repl.run
> For C++ : https://scarfcpp.isaacmeyer.repl.run
> For Ruby : https://scarfrb.isaacmeyer.repl.run
> For Crystal : https://scarfcr.isaacmeyer.repl.run/
> For Java : https://scarfjava.isaacmeyer.repl.run
> For C# : https://scarfcs.isaacmeyer.repl.run
> For Golang : https://scarfgo.isaacmeyer.repl.run

Any ideas for more languages that are on https://repl.it/ to port this to? (I have a loooot of free time)

EDIT : I added JSF***, I know I said I'll stay away from esoteric langs but curiosity got me

EDIT2 : I added Crystal, a faster ruby-like alternative
Those languages are all pretty similar-- if you want to learn something new, may I suggest Haskell and APL?
lirtosiast wrote:
Those languages are all pretty similar-- if you want to learn something new, may I suggest Haskell and APL?

Or BrainF*ck?
beckadamtheinventor wrote:
lirtosiast wrote:
Those languages are all pretty similar-- if you want to learn something new, may I suggest Haskell and APL?

Or BrainF*ck?

i've tried brainf*** for other programs, but prefer jsf***, but i'm trying to stay away from esoteric languages, and stick to the norm

EDIT : I tried to port it to jsf***

here's the code running : https://scarfjsf.isaacmeyer.repl.run/
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement