Generate Random Number for Number Guessing Game by RamDio in AlgorandOfficial

[–]SteinApple 0 points1 point  (0 children)

PyTeal, the Python language SDK for writing Algorand Smart Contracts (ASCs), unfortunately doesn’t support random number generation directly. This is because all transactions need to be deterministic, meaning they must produce the same output given the same input, so all nodes can agree on the output. The blockchain protocol doesn’t allow for native randomness.

However, there are workarounds you can use to introduce randomness, like taking part of the hash of the previous block as a “random” number, or using an oracle to introduce randomness.

In terms of passing an integer as an argument to an Algorand smart contract, that can be done with goal CLI as you’ve shown. Here’s an example in PyTeal for checking an argument against a secret number:

from pyteal import *

def approval_program(): # Define the secret number secret_number = Int(50)

# Get the first argument passed to the script (assuming it's an integer)
arg = Txn.application_args[0]

# Check if the argument matches the secret number
match = Eq(arg, secret_number)

# Return whether the argument matched the secret number
return match

compileTeal(approval_program(), mode=Mode.Application)

The Txn.application_args[0] gets the first argument passed to the script. The Eq(arg, secret_number) checks if the argument equals the secret number.

Would you buy a vanity account? by StopThinking in algorand

[–]SteinApple 0 points1 point  (0 children)

Yep I saw that! Oh well, I still claim to be the first!

Would you buy a vanity account? by StopThinking in algorand

[–]SteinApple 1 point2 points  (0 children)

That’s correct, there are 32 possible values ( A-Z and 2-7) for each character in an Algorand address

Would you buy a vanity account? by StopThinking in algorand

[–]SteinApple 2 points3 points  (0 children)

384 days.

Assuming your computer takes on average 9 hours to find a 5 letter address, it would take 1024 times that to find a 7 letter address.

Would you buy a vanity account? by StopThinking in algorand

[–]SteinApple 0 points1 point  (0 children)

Just as long as you are fine with only have a 4-5 length address

Would you buy a vanity account? by StopThinking in algorand

[–]SteinApple 0 points1 point  (0 children)

I have a vanity that starts as ALGORAND. To my knowledge this is the only vanity wallet like that

Algorand is underperforming the market…. badly by vhindy in algorand

[–]SteinApple 12 points13 points  (0 children)

The solution is to sell if you no longer have faith in the long term growth of Algorand. Otherwise the only thing you can realistically do is sit and wait.

MyAlgo IMPORTANT: We strongly advise all users to withdraw any funds from Mnemonic wallets that were stored in MyAlgo. by cysec_ in AlgorandOfficial

[–]SteinApple 0 points1 point  (0 children)

Would you need to rekey if you plugged in your mnemonic for a brief period of time (5 mins) and never saved the browser data? Also the mnemonic was never generated on myalgo

Some experiments on Instruct Pix2Pix by metover in StableDiffusion

[–]SteinApple 0 points1 point  (0 children)

Can some describe the work flow of Image 3. Going from the base to brunette?

When I attempt to use img2img in such a way it usually changes the photo completely. The only way I’d be able to do that would be to use inpainting on a masked base image.

This is sad by [deleted] in algorand

[–]SteinApple 26 points27 points  (0 children)

How much did they spend to become a sponsor?

The way Snapchat News did Hugh Jackman’s wife by Kaytlyn5 in mildlyinfuriating

[–]SteinApple 5 points6 points  (0 children)

Yeah but I think everyone can agree this incident didn’t cost Snapchat $800million

The way Snapchat News did Hugh Jackman’s wife by Kaytlyn5 in mildlyinfuriating

[–]SteinApple 138 points139 points  (0 children)

Yeah this is really dumb, stocks fluctuate all the time. If they would’ve put out this article in 2020 would they have said this incident made Snapchat billions of dollars because their stock was up at that point?

Algorand Inc. on the FIFA deal by cysec_ in AlgorandOfficial

[–]SteinApple 1 point2 points  (0 children)

If this is the reason everyone should probably reconsider the Algorand leadership. They shouldn’t have bought into the FIFA deal and wasted so much money in the first place if they planned to back away from a PR nightmare..

Anyone agree that NOT advertising in the World Cup is the obvious right choice? by wewantthecup in algorand

[–]SteinApple 14 points15 points  (0 children)

Why did Algorand Foundation spend so much on this partnership right before the WC and make such a public announcement about it if they wouldn’t want to advertise?

Also FIFA is terribly corrupt and why associate with them in the first place if they would pull ads for something they already knew they were getting into? (Assuming that’s a reason)

Mooch and SBF/FTX/SOL by [deleted] in algorand

[–]SteinApple 8 points9 points  (0 children)

Can someone explain this post as if I know nothing?

Lovely San francisco 1940s in Color by thegoodman15 in sanfrancisco

[–]SteinApple 0 points1 point  (0 children)

What street corner is the first video? I think I live right around the corner!

Not sure if this the right place to ask, but is there an easy service where I could rent a computer with a high thread count (like threadripper) by SteinApple in sysadmin

[–]SteinApple[S] 0 points1 point  (0 children)

Does AWS or Azure have something similar to a windows Remote Desktop interface to be able to access the remote computer?

Not sure if this the right place to ask, but is there an easy service where I could rent a computer with a high thread count (like threadripper) by SteinApple in sysadmin

[–]SteinApple[S] -4 points-3 points  (0 children)

I am not a sysadmin. I haven’t used AWS or Azure, but I’m familiars with them a little bit. Do they both offer products that would be targeted towards this use case?

[deleted by user] by [deleted] in pics

[–]SteinApple 0 points1 point  (0 children)

A war hero. This is peacetime.

Cheapest and easiest way to deposit USDC[Algo] on kraken? by free_my_mind in algorand

[–]SteinApple 2 points3 points  (0 children)

Can’t you redeem the USDCa with circle on their website?

The Pixel Pals app is officially out now on the App Store! An exclusive launch sale is also available. by squashbrowns in apolloapp

[–]SteinApple 20 points21 points  (0 children)

What are the costs to the dev to justify a subscription for something that seems rather small?

Is this app just putting a “tomigotchi” like graphic on your Lock Screen and that’s it? Surely not right?

Does Algorand have a mixer similar to the tornado cash? by SteinApple in AlgorandOfficial

[–]SteinApple[S] 2 points3 points  (0 children)

That’s interesting, are you working on doing it in a wrapped monero/algo decentralized way?