prev what are you working on Any Forums?
/dpt/ - daily programming thread
Other urls found in this thread:
github.com
vocaroo.com
twitter.com
nth for new memelang withdrawal
heh. fucking recursion.
rgb :: Color -> [Double]
rgb s = case s of
Red -> [1,0,0]
Green -> [0,1,0]
Blue -> [0,0,1]
Mix co ca -> map (\(c1,c2) -> (c1+c2) / 2 ) $ zip (rgb co) (rgb ca)
Invert cb -> map (\x -> 1-x) $ rgb cb
I can see why haskell and Oh! Camel! are used for parsers, interpreters and compilers.
Reminding anons to use github.com
JavaScript rocks!
I know nothing about low-level stuff, that's why I'm trying to learn.
Thanks for the recommendation, he does seem to have a book for 6502 assembly. I\ll check it out.
Good free online courses to learn programming and cryptography?
Someone critique my program please
>"I'm not doing your homework"
The due date for this past full over a week ago so any changes I would make to this now would be meaningless to my grade. Trying to learn how to make stuff like this more efficient because I know it probably has way more lines than it needs to be
>"Write a code that:"
>"Asks the user to input 5 items in a list and display the list. "
>"Ask the user to input the index where they would like to insert a new item."
>"Ask the user to input the item that they would like to insert into the list."
>"Inserts the new item into the list and displays the modified list. If the index is greater than the length of the list, simply insert the new item at the end of list."
My shit-tier code:
num = 5
l = []
print('1.) Enter the 5 numbers for your list')
for i in range(0, num):
element = int(input())
l.append(element)
print('list:', l)
ind = int(input('2.) Which index in the list would you like your number to be placed?'))
print(ind)
ze = l[0:1]
on = l[1:2]
tw = l[2:3]
th = l[3:4]
fo = l[4:5]
new = int(input('3.) what is the numhber being inserted?'))
new = [new]
if ind == 0:
a = (new) + (l)
print('4.) latest list:',a)
elif ind == 1:
b = (ze + new + on + tw + th + fo)
print('4.) latest list:',b)
elif ind == 2:
c = (ze + on + new + tw + th + fo)
print('4.) latest list:',c)
elif ind == 3:
d = (ze + on + tw + new + th + fo)
print('4.) latest list:',d)
elif ind == 4:
e = (ze + on + tw + th+ new + fo)
print('4.) latest list:',e)
else:
f = (l) + (new)
print("4.) latest list:",f)
[\code]
With some kind soul please rate this on a scale of 1 to 10 along with some critique?
1 being utter dog shiand 10 being a needs some improvement
>With some
*Would some
1
>utter dog shiand
Holy fuck speech to text is ass with a mask on
...go on...
it's dog shiand
try again but this time make it good
Also forgot to mention, we were forbidden from using commands like sort() and insert(), so obviously I had to improvise
>try again but this time make it good
Of course y'all we're going to try extra hard to be unhelpful LOL
move the parts into separate functions, it's good practice for becoming a SOLID wagie.
those index names are absolutely terrible nor do you even need them.
why are you redundantly checking against indexes you already know? It's an unnecessary step.
honestly scrap the whole thing and start over
arr = [1, 2, 3]
index = int(input("index: "))
value = int(input("value: "))
arr[index] = value
now go away
there should be two different ones
one is the bog standard 8bit asm tutorial content: "these are registers", "these are addressing modes", "here's a dry listing of all the opcodes".
and then the subroutine book with the good shit like "here's how those opcodes do actual math" and "this is what array and string handling will look like"
stupid q: are node.js and visual studio editor similar?
...
retard
blessed /dpt/ singer
Chill. I forgot to write print(arr). Just keep in mind that at some point in time you were just as if not more retarded than I am. I didn't start learning any of this until mid January. Your code works fine. Thanks but not really
dumb frogposter
computer viruses can't infect humans and vice versa, you don't need a mask to use one user.