Sponsored Content
Top Forums Programming How to set constrain on random numbers in c Post 302157414 by Perderabo on Thursday 10th of January 2008 11:13:29 PM
Old 01-11-2008
Your four variables are integers, each set to 1 + some integer. Three of them must stay at 1 and the fourth one can be two. Pick a number between 1 and 4 and increment only one variable based on that. You pick a 3, die3=2 and the rest stay at 1.
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Random numbers without repetition

Is anyone know some scripts to generate random number without repetition using bash; for example generate 10 different random numbers. Thanks (8 Replies)
Discussion started by: asal_email
8 Replies

2. Shell Programming and Scripting

Random numbers from 0 to 1000

Hello All, I want to make a simple script which generate random number from 0 to 1000. and simply display it. Plz HELP!!!!!! Regards, Waqas Ahmed (2 Replies)
Discussion started by: wakhan
2 Replies

3. UNIX for Dummies Questions & Answers

seperating records with numbers from a set of numbers

I have two files one (numbers file)contains the numbers(approximately 30000) and the other file(record file) contains the records(approximately 40000)which may or may not contain the numbers from that file. I want to seperate the records which has the field 1=(any of the number from numbers... (15 Replies)
Discussion started by: Shiv@jad
15 Replies

4. Shell Programming and Scripting

Random Numbers - Perl

Hi Guys I have a script to find Ranomd numbers. But I want to make the file to produce more random. Could u guys help me plz. In this Script I have the code that generates random in for loop and the range I have specified in my %chromlength input and out put will be like this chrno start end... (3 Replies)
Discussion started by: repinementer
3 Replies

5. Shell Programming and Scripting

Generating random numbers

Hi, I am having trouble with generating random numbers. can this be done with awk? So I have a file that looks like this: 23 30 24 40 26 34 So column1 is start and column2 is end. I want to generate 3 random #'s between start and stop: So the output will look like this: ... (9 Replies)
Discussion started by: phil_heath
9 Replies

6. Programming

Random numbers in parent/child?

Hi I'm trying to generate random numbers both in parent process and the child process. But I get the same random number in both processes. Why doesn't it generate different numbers altough I seed random number generator? Here's my code: #include <stdio.h> #include <unistd.h> #include... (2 Replies)
Discussion started by: xyzt
2 Replies

7. Shell Programming and Scripting

unique random numbers awk

Hi, I have a small piece of awk code (see below) that generates random numbers. gawk -F"," 'BEGIN { srand(); for (i = 1; i <= 30; i++) printf("%s AM329_%04d\n",$0,int(36 * rand())+1) }' OFS=, AM329_hole_names.csv The code works fine and generates alphanumeric numbers like AM329_0001,... (2 Replies)
Discussion started by: theflamingmoe
2 Replies

8. Shell Programming and Scripting

Generate random numbers in script

i want to generate a random number through a script, and even if anyone reads the script, they wont be able to figure out what the random number is. only the person who setup the script would know it. something like this could work: random the full thread is here: ... (13 Replies)
Discussion started by: SkySmart
13 Replies

9. Homework & Coursework Questions

Random numbers

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! Write a shell script that will take the sum of two random number? Ex: Random n1 +Random n2 = result i tries to write it but i had some dufficulties ... (3 Replies)
Discussion started by: renegade755
3 Replies
IBOD.CF(4)						     Kernel Interfaces Manual							IBOD.CF(4)

NAME
ibod.cf - configuration file for ibod (ISDN Bandwidth On Demand) DESCRIPTION
This file contains the initial configuration values for the ibod daemon. Each line contains a keyword and a value. Boolean attributes are set with 0 or 1 which corresponds to false and true respectively. A boolean attribute not specified at all is always false. Lines beginning with # are treated as comments and will be ignored. IMPORTANT RULES! 1. Keywords are case sensitive. 2. Kewords must begin at the first column. 3. Keywords and values must be separated by exactly one (1) space or tab character. This file is re-read every time ibod receives SIGHUP (1) signal. OPTIONS DEVICE <name> Name of ISDN PPP device. Default is ippp0. ENABLE 1|0 Enable/disable bandwidth-on-demand. Default is enable (1). INTERVAL <n> Specify the sample time interval in ms. Default is 500 ms. FILTER <n> Defines "filtering factor". A value of 10 means that the average bytes/sec value measured over 10 intervals must pass the limit defined by LIMIT to bring up or down the slave link. Default is 5. LIMIT <n> Transfer rate limit in bytes/sec for bringing up or down ISDN slave channel. Default is 7000. STAYUP 0|1 Enable/disable slave channel stay up function. If enabled, the 2:nd cannel (slave link) will stay up even if the average bytes/sec decrease the value defined by LIMIT. In this case the slave link will stay up until hangup time is reached. (Example: isdnctrl hup- timeout ippp1 60) If disabled the slave link will be brought down in the same way it was brought up. Default is 0. STAYUP_TIME <n> Defines the minimum time in seconds the 2:nd channel will unconditionally stay up after it has been brought up. Default value is 30. SEE ALSO
ibod(1) and xibod(1) AUTHOR
Bjoern Smith, Smith@Compound.SE IBOD.CF(4)
All times are GMT -4. The time now is 08:53 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy