covor2190 Posted December 24, 2020 Report Posted December 24, 2020 Salut. Poate cineva sa ma ajute in programare: Vreau ca dintr-un grup de 30 de numere, programul sa aleaga singur un numar. Numerele sunt de la 1 la 30, pe 2 culori (rosu si verde), si vreau ca dintr-un interval de 30 de numere, programul sa aleaga automat doar numarul cu verde (cand este disponibil, in majoratatea timpul find rosu, dar la un anumit timp eliberandu-se si un numar cu verde, aleator din cele 30), cand alege singur numarul verde, sa completeze automat toate campurile necesare (gen nume, prenume, etc.) si sa bifeze (nu sunt robot). Gen mai pe scurt, cand din cele 30 de numere rosii, apare un numar verde aleator, programul sa il bifeze singur si sa completeze campurile automat cu datele care le stabilesc eu dinainte. Multumesc. Daca ma poate ajuta cineva va rog sa imi lasati aici sau direct pe mail:covor2190@gmail.com , voi fi recunoscator. O zi buna la toti!!! Quote
Active Members MrGrj Posted December 24, 2020 Active Members Report Posted December 24, 2020 Salut, Io n-am inteles nimic din ceea ce vrei. - Care numere sunt verzi si care sunt rosii? - Sunt doua seturi de 30 de numere, un set fiind rosu si altul fiind verde? - Cum determini cand un numar e disponibil? - De unde au aparut campurile alea? Sunt prin Baragan? - Etc. Mersi Quote
covor2190 Posted December 24, 2020 Author Report Posted December 24, 2020 Inițial toate numerele de la 1 la 30 sunt roșii. Aleator la un interval de 30 minute, un număr devine verde (gen Nr 16 era roșu, după 30 minute a devenit verde) iar acel număr trebuie selectat automat (asta vreau sa fac prin programare, sa selecteze automat numărul, nu sa stau eu incontinuu sa selectez până devine verde, să aștept) si sa completeze campurile automat (gen numărul 16 daca îl selectezi îți va cere numele și prenumele) Quote
Kev Posted December 25, 2020 Report Posted December 25, 2020 (edited) Sa mor de nu am ramas in pom On: in ce limbaj? Edit: conctret pentru ce? pentru semafor, instalatie de brad etc.. Edited December 25, 2020 by Kev 1 Quote
covor2190 Posted December 25, 2020 Author Report Posted December 25, 2020 1)un grup de numere de la 1 la 30 (1,2,3,4,5...28,29,30) 2)numerele sa fie in tabel (linie si coloana, 1,2,3,4(L1)/ 5,6,7,8 (L2) / 9,10,11,12(L3) ... etc. pana la 30) 3)in tabel numerele sa fie reprezentate in culoare rosi (gen numarul sa fie rosu) 4)la interval de 30 minute, un numar din cele 30 (aleator) sa se transforme din culoare rosie in culoare verde 5)programul sa selecteze automat acel numar verde 6)dupa ce a selectat numarul verde, sa completeze campurile necesare, gen cand apesi pe orice numaru(1-30) apare sub tabel un camp in care cere urmatoarele info(nume,prenume,varsta,mail, etc...) 7)dupa ce a completat automat si a bifat numarul verde, o sa apara sub tabel si sub campurile completate anterior, bifare "NU SUNT ROBOT" Quote
ardu2222 Posted December 25, 2020 Report Posted December 25, 2020 1 hour ago, Kev said: Sa mor de nu am ramas in pom On: in ce limbaj? Edit: conctret pentru ce? pentru semafor, instalatie de brad etc.. Pentru parlament Quote
Moderators Dragos Posted December 25, 2020 Moderators Report Posted December 25, 2020 14 minutes ago, ardu2222 said: Pentru parlament Astia nici nu au intrat bine in functie si vor sa mai faca un ban la ruleta? 1 Quote
Kev Posted December 25, 2020 Report Posted December 25, 2020 ceva de genul vrei, puse pe tabel, si export, marca banu 1 Quote
Active Members MrGrj Posted December 25, 2020 Active Members Report Posted December 25, 2020 (edited) Cadou de Craciun import random import sys import time # generate numbers from 1 to 30 mapped to red color NUMBERS = {number: 'red' for number in list(range(1, 31))} class Colors: """ ANSI color codes. """ # RED is used for all the numbers RED = '\033[91m' # GREEN is used for displaying computer's random # chosen number GREEN = '\033[92m' # BLUE is used for displaying user's chosen # number BLUE = '\033[94m' END = '\033[0m' def assign_color_to_number(number, color): """ Show ANSI colors in terminal for nicer UX. """ if color == 'red': return f'{Colors.RED}{number}{Colors.END}' elif color == 'green': return f'{Colors.GREEN}{number}{Colors.END}' elif color == 'blue': return f'{Colors.BLUE}{number}{Colors.END}' else: return number def print_table(numbers): """ Print a nice table with colorful numbers wrapped at 5. """ print('\n') for number, color in numbers.items(): number = assign_color_to_number(number, color).ljust(12) if number % 5 != 0: print(number, end=' ') else: print(number) print('\n') def countdown(seconds, user_number): """ Let user know how much until the next game. Arguments: seconds (int): How many seconds until next game. user_number (int): User's lucky & chosen number. """ print(f"You chose {user_number}. GOOD LUCK!\n\n") for second in range(seconds, -1, -1): sys.stdout.write( f"\r{second} seconds remaining until one number will change its color to green." ) time.sleep(1) sys.stdout.flush() print('\n') def get_user_number(): """ Sanitize user's input. """ while True: try: value = int(input('Please choose a number between 1 and 30: ')) if 30 < value < 1: print("Please insert a number between 1 and 30!\n") continue return value except ValueError: print("Please insert a number between 1 and 30!\n") continue def play(): print_table(NUMBERS) user_number = get_user_number() countdown(5, user_number) random_number = random.randint(1, 30) if user_number != random_number: NUMBERS.update({random_number: 'green', user_number: 'blue'}) print_table(NUMBERS) print( f'You did not guess the number. Our number was: {random_number} ' f'and yours was: {user_number}.\n\nGOOD LUCK NEXT TIME' ) else: print( 'You guessed it! Congrats! Please fill in the information ' 'below in order to receive your prize.\n\n' ) name = input('Your name: ') age = input('Your age: ') email = input('Your email: ') print(f'Name: {name}\nAge: {age}\nEmail:{email}') # reset our numbers NUMBERS.update({random_number: 'red', user_number: 'red'}) def main(): print('\nWELCOME TO LOTTERY!') while True: play() answer = input('Play again? [Y]es/[N]o: ') if answer.lower() == 'n': break print('\nTHANKS FOR PLAYING!') if __name__ == '__main__': main() Aici ai si link cu codu' si poti sa ii dai un Run de test. Am pus si niste comment-uri in caz ca vrei sa intelegi ce se intampla, desi ma indoiesc. PS: Codu' e scris destul de repede but it does it job chiar daca nu e perfect organizat. Enjoy Edited December 25, 2020 by MrGrj 1 Quote
covor2190 Posted December 25, 2020 Author Report Posted December 25, 2020 2 hours ago, MrGrj said: Cadou de Craciun import random import sys import time # generate numbers from 1 to 30 mapped to red color NUMBERS = {number: 'red' for number in list(range(1, 31))} class Colors: """ ANSI color codes. """ # RED is used for all the numbers RED = '\033[91m' # GREEN is used for displaying computer's random # chosen number GREEN = '\033[92m' # BLUE is used for displaying user's chosen # number BLUE = '\033[94m' END = '\033[0m' def assign_color_to_number(number, color): """ Show ANSI colors in terminal for nicer UX. """ if color == 'red': return f'{Colors.RED}{number}{Colors.END}' elif color == 'green': return f'{Colors.GREEN}{number}{Colors.END}' elif color == 'blue': return f'{Colors.BLUE}{number}{Colors.END}' else: return number def print_table(numbers): """ Print a nice table with colorful numbers wrapped at 5. """ print('\n') for number, color in numbers.items(): number = assign_color_to_number(number, color).ljust(12) if number % 5 != 0: print(number, end=' ') else: print(number) print('\n') def countdown(seconds, user_number): """ Let user know how much until the next game. Arguments: seconds (int): How many seconds until next game. user_number (int): User's lucky & chosen number. """ print(f"You chose {user_number}. GOOD LUCK!\n\n") for second in range(seconds, -1, -1): sys.stdout.write( f"\r{second} seconds remaining until one number will change its color to green." ) time.sleep(1) sys.stdout.flush() print('\n') def get_user_number(): """ Sanitize user's input. """ while True: try: value = int(input('Please choose a number between 1 and 30: ')) if 30 < value < 1: print("Please insert a number between 1 and 30!\n") continue return value except ValueError: print("Please insert a number between 1 and 30!\n") continue def play(): print_table(NUMBERS) user_number = get_user_number() countdown(5, user_number) random_number = random.randint(1, 30) if user_number != random_number: NUMBERS.update({random_number: 'green', user_number: 'blue'}) print_table(NUMBERS) print( f'You did not guess the number. Our number was: {random_number} ' f'and yours was: {user_number}.\n\nGOOD LUCK NEXT TIME' ) else: print( 'You guessed it! Congrats! Please fill in the information ' 'below in order to receive your prize.\n\n' ) name = input('Your name: ') age = input('Your age: ') email = input('Your email: ') print(f'Name: {name}\nAge: {age}\nEmail:{email}') # reset our numbers NUMBERS.update({random_number: 'red', user_number: 'red'}) def main(): print('\nWELCOME TO LOTTERY!') while True: play() answer = input('Play again? [Y]es/[N]o: ') if answer.lower() == 'n': break print('\nTHANKS FOR PLAYING!') if __name__ == '__main__': main() Aici ai si link cu codu' si poti sa ii dai un Run de test. Am pus si niste comment-uri in caz ca vrei sa intelegi ce se intampla, desi ma indoiesc. PS: Codu' e scris destul de repede but it does it job chiar daca nu e perfect organizat. Enjoy mersi frumos, o intrebare,cum as putea lega acest cod sa functioneze pe un site web? mersi inca odata pentru ajutor gen vreau ca la un site care are doar grupul de nr, sa leg acest cod sa functioneze Quote
Active Members MrGrj Posted December 25, 2020 Active Members Report Posted December 25, 2020 In viata Dumnezeu iti da, da' nu-ti baga si-n gura. Fa si tu ceva research sau pune pe cineva sa iti faca asta contra-cost Nu e ca si cum ai intreba pe cineva: "Cum fac o ciocolata calda" si gata. Tre' sa pui ceva efort in asta. Good luck. 4 Quote
yoyois Posted December 25, 2020 Report Posted December 25, 2020 Nimeni nu intelege pt ca covor are 0 skill in a explica ce vrea. 1. Unde sunt numerele? Da link. 2. pune o poza. ce culoare? ce site? ce date? 3. pune un video cu tine facand ce vrei sa-ti faca scriptul. Nu avem noi citotor de minti sa stim daca e un joc video, o tema la liceu, un site web, aparatul de pacanele din bar, etc. Eu cred ca el are un site cu giveaway sau ceva de genul. si vrea sa-l fraiereasca. I-ati adio. butonul ala ce "nu sunt robot" de la google e ft ft greu de automatizat. nu-ti gasesti cuneva sa-ti bifeze butonul sub 200€ Quote
Kev Posted December 25, 2020 Report Posted December 25, 2020 (edited) 1 hour ago, yoyois said: I-ati adio. butonul ala ce "nu sunt robot" de la google e ft ft greu de automatizat. nu-ti gasesti cuneva sa-ti bifeze butonul sub 200€ http://www.megatypers.com https://rstforums.com/forum/topic/47808-cum-sa-faci-bani-rezolvand-captcha-uri/?tab=comments#comment-316622 Fix 200 "munca de chinezi" /pentru viitor, invatati limbajele cel putin la un low-level, iar ulterior puneti intrebari Edited December 25, 2020 by Kev 1 Quote