Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Sandbox

Get something random without functions [cancelled]

+0
−0

Introduction

Random integer challenges aren't new. They've been here for a while now, yet none exists on Codidact. It's also noted that there are built-in functions that allows you to get random integers, which makes things all the more easier. How about upping the game?

Challenge

  • Write a program that takes a random number (choose the range you want, but $-100 < n < 100$ is the minimum.
  • You can't use functions on this one. Yes, functions, not built-ins. The only exception here is main() if it's necessary.
  • Built-ins are technically allowed if it's from a golflang. Not so sure on mainstream languages.
  • Functions can't be used, mostly on mainstream languages.
  • The outputting can be implemented onto the main code, or don't if it's for testing. It's an optional choice.
  • Since this is a code-golf challenge, the shortest program in each language wins.
History
Why does this post require moderator attention?
You might want to add some details to your flag.

1 comment thread

"takes a random number" do you mean *output* one? "Built-ins allowed" well pretty much all golflangs... (2 comments)